imate
C++/CUDA Reference
py_c_trace_estimator.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.36 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "NPY_NO_DEPRECATED_API",
9  "NPY_1_7_API_VERSION"
10  ],
11  [
12  "CYTHON_EXTERN_C",
13  "extern \"C\""
14  ],
15  [
16  "NPY_NO_DEPRECATED_API",
17  "NPY_1_7_API_VERSION"
18  ],
19  [
20  "CYTHON_EXTERN_C",
21  "extern \"C\""
22  ],
23  [
24  "NPY_NO_DEPRECATED_API",
25  "NPY_1_7_API_VERSION"
26  ],
27  [
28  "CYTHON_EXTERN_C",
29  "extern \"C\""
30  ],
31  [
32  "NPY_NO_DEPRECATED_API",
33  "NPY_1_7_API_VERSION"
34  ],
35  [
36  "CYTHON_EXTERN_C",
37  "extern \"C\""
38  ],
39  [
40  "NPY_NO_DEPRECATED_API",
41  "NPY_1_7_API_VERSION"
42  ],
43  [
44  "CYTHON_EXTERN_C",
45  "extern \"C\""
46  ],
47  [
48  "NPY_NO_DEPRECATED_API",
49  "NPY_1_7_API_VERSION"
50  ],
51  [
52  "CYTHON_EXTERN_C",
53  "extern \"C\""
54  ],
55  [
56  "NPY_NO_DEPRECATED_API",
57  "NPY_1_7_API_VERSION"
58  ],
59  [
60  "CYTHON_EXTERN_C",
61  "extern \"C\""
62  ],
63  [
64  "NPY_NO_DEPRECATED_API",
65  "NPY_1_7_API_VERSION"
66  ],
67  [
68  "CYTHON_EXTERN_C",
69  "extern \"C\""
70  ],
71  [
72  "NPY_NO_DEPRECATED_API",
73  "NPY_1_7_API_VERSION"
74  ],
75  [
76  "CYTHON_EXTERN_C",
77  "extern \"C\""
78  ],
79  [
80  "NPY_NO_DEPRECATED_API",
81  "NPY_1_7_API_VERSION"
82  ],
83  [
84  "CYTHON_EXTERN_C",
85  "extern \"C\""
86  ],
87  [
88  "NPY_NO_DEPRECATED_API",
89  "NPY_1_7_API_VERSION"
90  ],
91  [
92  "CYTHON_EXTERN_C",
93  "extern \"C\""
94  ],
95  [
96  "NPY_NO_DEPRECATED_API",
97  "NPY_1_7_API_VERSION"
98  ],
99  [
100  "CYTHON_EXTERN_C",
101  "extern \"C\""
102  ],
103  [
104  "NPY_NO_DEPRECATED_API",
105  "NPY_1_7_API_VERSION"
106  ],
107  [
108  "CYTHON_EXTERN_C",
109  "extern \"C\""
110  ],
111  [
112  "NPY_NO_DEPRECATED_API",
113  "NPY_1_7_API_VERSION"
114  ],
115  [
116  "CYTHON_EXTERN_C",
117  "extern \"C\""
118  ],
119  [
120  "NPY_NO_DEPRECATED_API",
121  "NPY_1_7_API_VERSION"
122  ],
123  [
124  "CYTHON_EXTERN_C",
125  "extern \"C\""
126  ]
127  ],
128  "depends": [
129  "imate/_c_linear_operator/c_linear_operator.h",
130  "imate/_c_trace_estimator/c_trace_estimator.h",
131  "imate/functions/exponential.h",
132  "imate/functions/functions.h",
133  "imate/functions/gaussian.h",
134  "imate/functions/homographic.h",
135  "imate/functions/identity.h",
136  "imate/functions/indicator.h",
137  "imate/functions/inverse.h",
138  "imate/functions/logarithm.h",
139  "imate/functions/smoothstep.h"
140  ],
141  "include_dirs": [
142  "./imate/functions",
143  "./imate/_c_linear_operator",
144  "./imate/_c_trace_estimator",
145  "i",
146  "m",
147  "a",
148  "t",
149  "e",
150  "/",
151  "_",
152  "c",
153  "l",
154  "n",
155  "r",
156  "o",
157  "p",
158  "b",
159  "s",
160  "g",
161  "d",
162  "u"
163  ],
164  "language": "c++",
165  "name": "imate._c_trace_estimator.py_c_trace_estimator",
166  "sources": [
167  "./imate/_c_trace_estimator/py_c_trace_estimator.pyx",
168  "./imate/_c_trace_estimator/diagonalization.cpp",
169  "./imate/_c_trace_estimator/c_lanczos_tridiagonalization.cpp",
170  "./imate/_c_trace_estimator/special_functions.cpp",
171  "./imate/_c_trace_estimator/lapack_api.cpp",
172  "./imate/_c_trace_estimator/c_golub_kahn_bidiagonalization.cpp",
173  "./imate/_c_trace_estimator/c_orthogonalization.cpp",
174  "./imate/_c_trace_estimator/convergence_tools.cpp",
175  "./imate/_c_trace_estimator/c_trace_estimator.cpp",
176  "imate/_c_linear_operator/c_dense_matrix.cpp",
177  "imate/_c_linear_operator/c_dense_affine_matrix_function.cpp",
178  "imate/_c_linear_operator/c_affine_matrix_function.cpp",
179  "imate/_c_linear_operator/c_matrix.cpp",
180  "imate/_c_linear_operator/c_csr_affine_matrix_function.cpp",
181  "imate/_c_linear_operator/c_linear_operator.cpp",
182  "imate/_c_linear_operator/c_csc_affine_matrix_function.cpp",
183  "imate/_c_linear_operator/c_csc_matrix.cpp",
184  "imate/_c_linear_operator/c_csr_matrix.cpp",
185  "imate/_c_basic_algebra/c_vector_operations.cpp",
186  "imate/_c_basic_algebra/cblas_interface.cpp",
187  "imate/_c_basic_algebra/c_matrix_operations.cpp",
188  "imate/_random_generator/split_mix_64.cpp",
189  "imate/_random_generator/xoshiro_256_star_star.cpp",
190  "imate/_random_generator/random_array_generator.cpp",
191  "imate/_random_generator/random_number_generator.cpp",
192  "imate/_utilities/timer.cpp"
193  ]
194  },
195  "module_name": "imate._c_trace_estimator.py_c_trace_estimator"
196 }
197 END: Cython Metadata */
198 
199 #ifndef PY_SSIZE_T_CLEAN
200 #define PY_SSIZE_T_CLEAN
201 #endif /* PY_SSIZE_T_CLEAN */
202 #include "Python.h"
203 #ifndef Py_PYTHON_H
204  #error Python headers needed to compile C extensions, please install development version of Python.
205 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
206  #error Cython requires Python 2.6+ or Python 3.3+.
207 #else
208 #define CYTHON_ABI "0_29_36"
209 #define CYTHON_HEX_VERSION 0x001D24F0
210 #define CYTHON_FUTURE_DIVISION 1
211 #include <stddef.h>
212 #ifndef offsetof
213  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
214 #endif
215 #if !defined(WIN32) && !defined(MS_WINDOWS)
216  #ifndef __stdcall
217  #define __stdcall
218  #endif
219  #ifndef __cdecl
220  #define __cdecl
221  #endif
222  #ifndef __fastcall
223  #define __fastcall
224  #endif
225 #endif
226 #ifndef DL_IMPORT
227  #define DL_IMPORT(t) t
228 #endif
229 #ifndef DL_EXPORT
230  #define DL_EXPORT(t) t
231 #endif
232 #define __PYX_COMMA ,
233 #ifndef HAVE_LONG_LONG
234  #if PY_VERSION_HEX >= 0x02070000
235  #define HAVE_LONG_LONG
236  #endif
237 #endif
238 #ifndef PY_LONG_LONG
239  #define PY_LONG_LONG LONG_LONG
240 #endif
241 #ifndef Py_HUGE_VAL
242  #define Py_HUGE_VAL HUGE_VAL
243 #endif
244 #ifdef PYPY_VERSION
245  #define CYTHON_COMPILING_IN_PYPY 1
246  #define CYTHON_COMPILING_IN_PYSTON 0
247  #define CYTHON_COMPILING_IN_CPYTHON 0
248  #define CYTHON_COMPILING_IN_NOGIL 0
249  #undef CYTHON_USE_TYPE_SLOTS
250  #define CYTHON_USE_TYPE_SLOTS 0
251  #undef CYTHON_USE_PYTYPE_LOOKUP
252  #define CYTHON_USE_PYTYPE_LOOKUP 0
253  #if PY_VERSION_HEX < 0x03050000
254  #undef CYTHON_USE_ASYNC_SLOTS
255  #define CYTHON_USE_ASYNC_SLOTS 0
256  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
257  #define CYTHON_USE_ASYNC_SLOTS 1
258  #endif
259  #undef CYTHON_USE_PYLIST_INTERNALS
260  #define CYTHON_USE_PYLIST_INTERNALS 0
261  #undef CYTHON_USE_UNICODE_INTERNALS
262  #define CYTHON_USE_UNICODE_INTERNALS 0
263  #undef CYTHON_USE_UNICODE_WRITER
264  #define CYTHON_USE_UNICODE_WRITER 0
265  #undef CYTHON_USE_PYLONG_INTERNALS
266  #define CYTHON_USE_PYLONG_INTERNALS 0
267  #undef CYTHON_AVOID_BORROWED_REFS
268  #define CYTHON_AVOID_BORROWED_REFS 1
269  #undef CYTHON_ASSUME_SAFE_MACROS
270  #define CYTHON_ASSUME_SAFE_MACROS 0
271  #undef CYTHON_UNPACK_METHODS
272  #define CYTHON_UNPACK_METHODS 0
273  #undef CYTHON_FAST_THREAD_STATE
274  #define CYTHON_FAST_THREAD_STATE 0
275  #undef CYTHON_FAST_PYCALL
276  #define CYTHON_FAST_PYCALL 0
277  #if PY_VERSION_HEX < 0x03090000
278  #undef CYTHON_PEP489_MULTI_PHASE_INIT
279  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
280  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
281  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
282  #endif
283  #undef CYTHON_USE_TP_FINALIZE
284  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
285  #undef CYTHON_USE_DICT_VERSIONS
286  #define CYTHON_USE_DICT_VERSIONS 0
287  #undef CYTHON_USE_EXC_INFO_STACK
288  #define CYTHON_USE_EXC_INFO_STACK 0
289  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
290  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
291  #endif
292 #elif defined(PYSTON_VERSION)
293  #define CYTHON_COMPILING_IN_PYPY 0
294  #define CYTHON_COMPILING_IN_PYSTON 1
295  #define CYTHON_COMPILING_IN_CPYTHON 0
296  #define CYTHON_COMPILING_IN_NOGIL 0
297  #ifndef CYTHON_USE_TYPE_SLOTS
298  #define CYTHON_USE_TYPE_SLOTS 1
299  #endif
300  #undef CYTHON_USE_PYTYPE_LOOKUP
301  #define CYTHON_USE_PYTYPE_LOOKUP 0
302  #undef CYTHON_USE_ASYNC_SLOTS
303  #define CYTHON_USE_ASYNC_SLOTS 0
304  #undef CYTHON_USE_PYLIST_INTERNALS
305  #define CYTHON_USE_PYLIST_INTERNALS 0
306  #ifndef CYTHON_USE_UNICODE_INTERNALS
307  #define CYTHON_USE_UNICODE_INTERNALS 1
308  #endif
309  #undef CYTHON_USE_UNICODE_WRITER
310  #define CYTHON_USE_UNICODE_WRITER 0
311  #undef CYTHON_USE_PYLONG_INTERNALS
312  #define CYTHON_USE_PYLONG_INTERNALS 0
313  #ifndef CYTHON_AVOID_BORROWED_REFS
314  #define CYTHON_AVOID_BORROWED_REFS 0
315  #endif
316  #ifndef CYTHON_ASSUME_SAFE_MACROS
317  #define CYTHON_ASSUME_SAFE_MACROS 1
318  #endif
319  #ifndef CYTHON_UNPACK_METHODS
320  #define CYTHON_UNPACK_METHODS 1
321  #endif
322  #undef CYTHON_FAST_THREAD_STATE
323  #define CYTHON_FAST_THREAD_STATE 0
324  #undef CYTHON_FAST_PYCALL
325  #define CYTHON_FAST_PYCALL 0
326  #undef CYTHON_PEP489_MULTI_PHASE_INIT
327  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
328  #undef CYTHON_USE_TP_FINALIZE
329  #define CYTHON_USE_TP_FINALIZE 0
330  #undef CYTHON_USE_DICT_VERSIONS
331  #define CYTHON_USE_DICT_VERSIONS 0
332  #undef CYTHON_USE_EXC_INFO_STACK
333  #define CYTHON_USE_EXC_INFO_STACK 0
334  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
335  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
336  #endif
337 #elif defined(PY_NOGIL)
338  #define CYTHON_COMPILING_IN_PYPY 0
339  #define CYTHON_COMPILING_IN_PYSTON 0
340  #define CYTHON_COMPILING_IN_CPYTHON 0
341  #define CYTHON_COMPILING_IN_NOGIL 1
342  #ifndef CYTHON_USE_TYPE_SLOTS
343  #define CYTHON_USE_TYPE_SLOTS 1
344  #endif
345  #undef CYTHON_USE_PYTYPE_LOOKUP
346  #define CYTHON_USE_PYTYPE_LOOKUP 0
347  #ifndef CYTHON_USE_ASYNC_SLOTS
348  #define CYTHON_USE_ASYNC_SLOTS 1
349  #endif
350  #undef CYTHON_USE_PYLIST_INTERNALS
351  #define CYTHON_USE_PYLIST_INTERNALS 0
352  #ifndef CYTHON_USE_UNICODE_INTERNALS
353  #define CYTHON_USE_UNICODE_INTERNALS 1
354  #endif
355  #undef CYTHON_USE_UNICODE_WRITER
356  #define CYTHON_USE_UNICODE_WRITER 0
357  #undef CYTHON_USE_PYLONG_INTERNALS
358  #define CYTHON_USE_PYLONG_INTERNALS 0
359  #ifndef CYTHON_AVOID_BORROWED_REFS
360  #define CYTHON_AVOID_BORROWED_REFS 0
361  #endif
362  #ifndef CYTHON_ASSUME_SAFE_MACROS
363  #define CYTHON_ASSUME_SAFE_MACROS 1
364  #endif
365  #ifndef CYTHON_UNPACK_METHODS
366  #define CYTHON_UNPACK_METHODS 1
367  #endif
368  #undef CYTHON_FAST_THREAD_STATE
369  #define CYTHON_FAST_THREAD_STATE 0
370  #undef CYTHON_FAST_PYCALL
371  #define CYTHON_FAST_PYCALL 0
372  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
373  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
374  #endif
375  #ifndef CYTHON_USE_TP_FINALIZE
376  #define CYTHON_USE_TP_FINALIZE 1
377  #endif
378  #undef CYTHON_USE_DICT_VERSIONS
379  #define CYTHON_USE_DICT_VERSIONS 0
380  #undef CYTHON_USE_EXC_INFO_STACK
381  #define CYTHON_USE_EXC_INFO_STACK 0
382 #else
383  #define CYTHON_COMPILING_IN_PYPY 0
384  #define CYTHON_COMPILING_IN_PYSTON 0
385  #define CYTHON_COMPILING_IN_CPYTHON 1
386  #define CYTHON_COMPILING_IN_NOGIL 0
387  #ifndef CYTHON_USE_TYPE_SLOTS
388  #define CYTHON_USE_TYPE_SLOTS 1
389  #endif
390  #if PY_VERSION_HEX < 0x02070000
391  #undef CYTHON_USE_PYTYPE_LOOKUP
392  #define CYTHON_USE_PYTYPE_LOOKUP 0
393  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
394  #define CYTHON_USE_PYTYPE_LOOKUP 1
395  #endif
396  #if PY_MAJOR_VERSION < 3
397  #undef CYTHON_USE_ASYNC_SLOTS
398  #define CYTHON_USE_ASYNC_SLOTS 0
399  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
400  #define CYTHON_USE_ASYNC_SLOTS 1
401  #endif
402  #if PY_VERSION_HEX < 0x02070000
403  #undef CYTHON_USE_PYLONG_INTERNALS
404  #define CYTHON_USE_PYLONG_INTERNALS 0
405  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
406  #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
407  #endif
408  #ifndef CYTHON_USE_PYLIST_INTERNALS
409  #define CYTHON_USE_PYLIST_INTERNALS 1
410  #endif
411  #ifndef CYTHON_USE_UNICODE_INTERNALS
412  #define CYTHON_USE_UNICODE_INTERNALS 1
413  #endif
414  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
415  #undef CYTHON_USE_UNICODE_WRITER
416  #define CYTHON_USE_UNICODE_WRITER 0
417  #elif !defined(CYTHON_USE_UNICODE_WRITER)
418  #define CYTHON_USE_UNICODE_WRITER 1
419  #endif
420  #ifndef CYTHON_AVOID_BORROWED_REFS
421  #define CYTHON_AVOID_BORROWED_REFS 0
422  #endif
423  #ifndef CYTHON_ASSUME_SAFE_MACROS
424  #define CYTHON_ASSUME_SAFE_MACROS 1
425  #endif
426  #ifndef CYTHON_UNPACK_METHODS
427  #define CYTHON_UNPACK_METHODS 1
428  #endif
429  #if PY_VERSION_HEX >= 0x030B00A4
430  #undef CYTHON_FAST_THREAD_STATE
431  #define CYTHON_FAST_THREAD_STATE 0
432  #elif !defined(CYTHON_FAST_THREAD_STATE)
433  #define CYTHON_FAST_THREAD_STATE 1
434  #endif
435  #ifndef CYTHON_FAST_PYCALL
436  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
437  #endif
438  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
439  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
440  #endif
441  #ifndef CYTHON_USE_TP_FINALIZE
442  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
443  #endif
444  #ifndef CYTHON_USE_DICT_VERSIONS
445  #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
446  #endif
447  #if PY_VERSION_HEX >= 0x030B00A4
448  #undef CYTHON_USE_EXC_INFO_STACK
449  #define CYTHON_USE_EXC_INFO_STACK 0
450  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
451  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
452  #endif
453  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
454  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
455  #endif
456 #endif
457 #if !defined(CYTHON_FAST_PYCCALL)
458 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
459 #endif
460 #if CYTHON_USE_PYLONG_INTERNALS
461  #if PY_MAJOR_VERSION < 3
462  #include "longintrepr.h"
463  #endif
464  #undef SHIFT
465  #undef BASE
466  #undef MASK
467  #ifdef SIZEOF_VOID_P
468  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
469  #endif
470 #endif
471 #ifndef __has_attribute
472  #define __has_attribute(x) 0
473 #endif
474 #ifndef __has_cpp_attribute
475  #define __has_cpp_attribute(x) 0
476 #endif
477 #ifndef CYTHON_RESTRICT
478  #if defined(__GNUC__)
479  #define CYTHON_RESTRICT __restrict__
480  #elif defined(_MSC_VER) && _MSC_VER >= 1400
481  #define CYTHON_RESTRICT __restrict
482  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
483  #define CYTHON_RESTRICT restrict
484  #else
485  #define CYTHON_RESTRICT
486  #endif
487 #endif
488 #ifndef CYTHON_UNUSED
489 # if defined(__GNUC__)
490 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
491 # define CYTHON_UNUSED __attribute__ ((__unused__))
492 # else
493 # define CYTHON_UNUSED
494 # endif
495 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
496 # define CYTHON_UNUSED __attribute__ ((__unused__))
497 # else
498 # define CYTHON_UNUSED
499 # endif
500 #endif
501 #ifndef CYTHON_MAYBE_UNUSED_VAR
502 # if defined(__cplusplus)
503  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
504 # else
505 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
506 # endif
507 #endif
508 #ifndef CYTHON_NCP_UNUSED
509 # if CYTHON_COMPILING_IN_CPYTHON
510 # define CYTHON_NCP_UNUSED
511 # else
512 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
513 # endif
514 #endif
515 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
516 #ifdef _MSC_VER
517  #ifndef _MSC_STDINT_H_
518  #if _MSC_VER < 1300
519  typedef unsigned char uint8_t;
520  typedef unsigned int uint32_t;
521  #else
522  typedef unsigned __int8 uint8_t;
523  typedef unsigned __int32 uint32_t;
524  #endif
525  #endif
526 #else
527  #include <stdint.h>
528 #endif
529 #ifndef CYTHON_FALLTHROUGH
530  #if defined(__cplusplus) && __cplusplus >= 201103L
531  #if __has_cpp_attribute(fallthrough)
532  #define CYTHON_FALLTHROUGH [[fallthrough]]
533  #elif __has_cpp_attribute(clang::fallthrough)
534  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
535  #elif __has_cpp_attribute(gnu::fallthrough)
536  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
537  #endif
538  #endif
539  #ifndef CYTHON_FALLTHROUGH
540  #if __has_attribute(fallthrough)
541  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
542  #else
543  #define CYTHON_FALLTHROUGH
544  #endif
545  #endif
546  #if defined(__clang__ ) && defined(__apple_build_version__)
547  #if __apple_build_version__ < 7000000
548  #undef CYTHON_FALLTHROUGH
549  #define CYTHON_FALLTHROUGH
550  #endif
551  #endif
552 #endif
553 
554 #ifndef __cplusplus
555  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
556 #endif
557 #ifndef CYTHON_INLINE
558  #if defined(__clang__)
559  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
560  #else
561  #define CYTHON_INLINE inline
562  #endif
563 #endif
564 template<typename T>
565 void __Pyx_call_destructor(T& x) {
566  x.~T();
567 }
568 template<typename T>
569 class __Pyx_FakeReference {
570  public:
571  __Pyx_FakeReference() : ptr(NULL) { }
572  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
573  T *operator->() { return ptr; }
574  T *operator&() { return ptr; }
575  operator T&() { return *ptr; }
576  template<typename U> bool operator ==(U other) { return *ptr == other; }
577  template<typename U> bool operator !=(U other) { return *ptr != other; }
578  private:
579  T *ptr;
580 };
581 
582 #define __PYX_BUILD_PY_SSIZE_T "n"
583 #define CYTHON_FORMAT_SSIZE_T "z"
584 #if PY_MAJOR_VERSION < 3
585  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
586  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
587  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
588  #define __Pyx_DefaultClassType PyClass_Type
589 #else
590  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
591  #define __Pyx_DefaultClassType PyType_Type
592 #if PY_VERSION_HEX >= 0x030B00A1
593  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
594  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
595  PyObject *fv, PyObject *cell, PyObject* fn,
596  PyObject *name, int fline, PyObject *lnos) {
597  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
598  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
599  const char *fn_cstr=NULL;
600  const char *name_cstr=NULL;
601  PyCodeObject* co=NULL;
602  PyObject *type, *value, *traceback;
603  PyErr_Fetch(&type, &value, &traceback);
604  if (!(kwds=PyDict_New())) goto end;
605  if (!(argcount=PyLong_FromLong(a))) goto end;
606  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
607  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
608  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
609  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
610  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
611  if (!(nlocals=PyLong_FromLong(l))) goto end;
612  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
613  if (!(stacksize=PyLong_FromLong(s))) goto end;
614  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
615  if (!(flags=PyLong_FromLong(f))) goto end;
616  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
617  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
618  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
619  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
620  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
621  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
622  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
623  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
624  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
625  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
626  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
627  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
628  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
629  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
630  Py_XDECREF((PyObject*)co);
631  co = (PyCodeObject*)call_result;
632  call_result = NULL;
633  if (0) {
634  cleanup_code_too:
635  Py_XDECREF((PyObject*)co);
636  co = NULL;
637  }
638  end:
639  Py_XDECREF(kwds);
640  Py_XDECREF(argcount);
641  Py_XDECREF(posonlyargcount);
642  Py_XDECREF(kwonlyargcount);
643  Py_XDECREF(nlocals);
644  Py_XDECREF(stacksize);
645  Py_XDECREF(replace);
646  Py_XDECREF(call_result);
647  Py_XDECREF(empty);
648  if (type) {
649  PyErr_Restore(type, value, traceback);
650  }
651  return co;
652  }
653 #else
654  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
655  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
656 #endif
657  #define __Pyx_DefaultClassType PyType_Type
658 #endif
659 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
660  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
661 #else
662  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
663 #endif
664 #ifndef Py_TPFLAGS_CHECKTYPES
665  #define Py_TPFLAGS_CHECKTYPES 0
666 #endif
667 #ifndef Py_TPFLAGS_HAVE_INDEX
668  #define Py_TPFLAGS_HAVE_INDEX 0
669 #endif
670 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
671  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
672 #endif
673 #ifndef Py_TPFLAGS_HAVE_FINALIZE
674  #define Py_TPFLAGS_HAVE_FINALIZE 0
675 #endif
676 #ifndef METH_STACKLESS
677  #define METH_STACKLESS 0
678 #endif
679 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
680  #ifndef METH_FASTCALL
681  #define METH_FASTCALL 0x80
682  #endif
683  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
684  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
685  Py_ssize_t nargs, PyObject *kwnames);
686 #else
687  #define __Pyx_PyCFunctionFast _PyCFunctionFast
688  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
689 #endif
690 #if CYTHON_FAST_PYCCALL
691 #define __Pyx_PyFastCFunction_Check(func)\
692  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
693 #else
694 #define __Pyx_PyFastCFunction_Check(func) 0
695 #endif
696 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
697  #define PyObject_Malloc(s) PyMem_Malloc(s)
698  #define PyObject_Free(p) PyMem_Free(p)
699  #define PyObject_Realloc(p) PyMem_Realloc(p)
700 #endif
701 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
702  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
703  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
704  #define PyMem_RawFree(p) PyMem_Free(p)
705 #endif
706 #if CYTHON_COMPILING_IN_PYSTON
707  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
708  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
709 #else
710  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
711  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
712 #endif
713 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
714  #define __Pyx_PyThreadState_Current PyThreadState_GET()
715 #elif PY_VERSION_HEX >= 0x03060000
716  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
717 #elif PY_VERSION_HEX >= 0x03000000
718  #define __Pyx_PyThreadState_Current PyThreadState_GET()
719 #else
720  #define __Pyx_PyThreadState_Current _PyThreadState_Current
721 #endif
722 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
723 #include "pythread.h"
724 #define Py_tss_NEEDS_INIT 0
725 typedef int Py_tss_t;
726 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
727  *key = PyThread_create_key();
728  return 0;
729 }
730 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
731  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
732  *key = Py_tss_NEEDS_INIT;
733  return key;
734 }
735 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
736  PyObject_Free(key);
737 }
738 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
739  return *key != Py_tss_NEEDS_INIT;
740 }
741 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
742  PyThread_delete_key(*key);
743  *key = Py_tss_NEEDS_INIT;
744 }
745 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
746  return PyThread_set_key_value(*key, value);
747 }
748 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
749  return PyThread_get_key_value(*key);
750 }
751 #endif
752 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
753 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
754 #else
755 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
756 #endif
757 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
758  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
759  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
760 #else
761  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
762  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
763 #endif
764 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
765 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
766 #else
767 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
768 #endif
769 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
770  #define CYTHON_PEP393_ENABLED 1
771  #if PY_VERSION_HEX >= 0x030C0000
772  #define __Pyx_PyUnicode_READY(op) (0)
773  #else
774  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
775  0 : _PyUnicode_Ready((PyObject *)(op)))
776  #endif
777  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
778  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
779  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
780  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
781  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
782  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
783  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
784  #if PY_VERSION_HEX >= 0x030C0000
785  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
786  #else
787  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
788  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
789  #else
790  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
791  #endif
792  #endif
793 #else
794  #define CYTHON_PEP393_ENABLED 0
795  #define PyUnicode_1BYTE_KIND 1
796  #define PyUnicode_2BYTE_KIND 2
797  #define PyUnicode_4BYTE_KIND 4
798  #define __Pyx_PyUnicode_READY(op) (0)
799  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
800  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
801  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
802  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
803  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
804  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
805  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
806  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
807 #endif
808 #if CYTHON_COMPILING_IN_PYPY
809  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
810  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
811 #else
812  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
813  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
814  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
815 #endif
816 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
817  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
818 #endif
819 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
820  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
821 #endif
822 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
823  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
824 #endif
825 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
826 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
827 #if PY_MAJOR_VERSION >= 3
828  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
829 #else
830  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
831 #endif
832 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
833  #define PyObject_ASCII(o) PyObject_Repr(o)
834 #endif
835 #if PY_MAJOR_VERSION >= 3
836  #define PyBaseString_Type PyUnicode_Type
837  #define PyStringObject PyUnicodeObject
838  #define PyString_Type PyUnicode_Type
839  #define PyString_Check PyUnicode_Check
840  #define PyString_CheckExact PyUnicode_CheckExact
841 #ifndef PyObject_Unicode
842  #define PyObject_Unicode PyObject_Str
843 #endif
844 #endif
845 #if PY_MAJOR_VERSION >= 3
846  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
847  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
848 #else
849  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
850  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
851 #endif
852 #ifndef PySet_CheckExact
853  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
854 #endif
855 #if PY_VERSION_HEX >= 0x030900A4
856  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
857  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
858 #else
859  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
860  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
861 #endif
862 #if CYTHON_ASSUME_SAFE_MACROS
863  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
864 #else
865  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
866 #endif
867 #if PY_MAJOR_VERSION >= 3
868  #define PyIntObject PyLongObject
869  #define PyInt_Type PyLong_Type
870  #define PyInt_Check(op) PyLong_Check(op)
871  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
872  #define PyInt_FromString PyLong_FromString
873  #define PyInt_FromUnicode PyLong_FromUnicode
874  #define PyInt_FromLong PyLong_FromLong
875  #define PyInt_FromSize_t PyLong_FromSize_t
876  #define PyInt_FromSsize_t PyLong_FromSsize_t
877  #define PyInt_AsLong PyLong_AsLong
878  #define PyInt_AS_LONG PyLong_AS_LONG
879  #define PyInt_AsSsize_t PyLong_AsSsize_t
880  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
881  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
882  #define PyNumber_Int PyNumber_Long
883 #endif
884 #if PY_MAJOR_VERSION >= 3
885  #define PyBoolObject PyLongObject
886 #endif
887 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
888  #ifndef PyUnicode_InternFromString
889  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
890  #endif
891 #endif
892 #if PY_VERSION_HEX < 0x030200A4
893  typedef long Py_hash_t;
894  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
895  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
896 #else
897  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
898  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
899 #endif
900 #if PY_MAJOR_VERSION >= 3
901  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
902 #else
903  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
904 #endif
905 #if CYTHON_USE_ASYNC_SLOTS
906  #if PY_VERSION_HEX >= 0x030500B1
907  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
908  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
909  #else
910  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
911  #endif
912 #else
913  #define __Pyx_PyType_AsAsync(obj) NULL
914 #endif
915 #ifndef __Pyx_PyAsyncMethodsStruct
916  typedef struct {
917  unaryfunc am_await;
918  unaryfunc am_aiter;
919  unaryfunc am_anext;
920  } __Pyx_PyAsyncMethodsStruct;
921 #endif
922 
923 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
924  #if !defined(_USE_MATH_DEFINES)
925  #define _USE_MATH_DEFINES
926  #endif
927 #endif
928 #include <math.h>
929 #ifdef NAN
930 #define __PYX_NAN() ((float) NAN)
931 #else
932 static CYTHON_INLINE float __PYX_NAN() {
933  float value;
934  memset(&value, 0xFF, sizeof(value));
935  return value;
936 }
937 #endif
938 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
939 #define __Pyx_truncl trunc
940 #else
941 #define __Pyx_truncl truncl
942 #endif
943 
944 #define __PYX_MARK_ERR_POS(f_index, lineno) \
945  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
946 #define __PYX_ERR(f_index, lineno, Ln_error) \
947  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
948 
949 #ifndef __PYX_EXTERN_C
950  #ifdef __cplusplus
951  #define __PYX_EXTERN_C extern "C"
952  #else
953  #define __PYX_EXTERN_C extern
954  #endif
955 #endif
956 
957 #define __PYX_HAVE__imate___c_trace_estimator__py_c_trace_estimator
958 #define __PYX_HAVE_API__imate___c_trace_estimator__py_c_trace_estimator
959 /* Early includes */
960 #include "functions.h"
961 #include "identity.h"
962 #include "ios"
963 #include "new"
964 #include "stdexcept"
965 #include "typeinfo"
966 #include "indicator.h"
967 #include "inverse.h"
968 #include "homographic.h"
969 #include "logarithm.h"
970 #include "exponential.h"
971 #include "gaussian.h"
972 #include "smoothstep.h"
973 #include "c_linear_operator.h"
974 #include <math.h>
975 #include <string.h>
976 #include <stdlib.h>
977 #include "c_trace_estimator.h"
978 #include "pythread.h"
979 #include <stdio.h>
980 #include "pystate.h"
981 #ifdef _OPENMP
982 #include <omp.h>
983 #endif /* _OPENMP */
984 
985 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
986 #define CYTHON_WITHOUT_ASSERTIONS
987 #endif
988 
989 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
990  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
991 
992 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
993 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
994 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
995 #define __PYX_DEFAULT_STRING_ENCODING ""
996 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
997 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
998 #define __Pyx_uchar_cast(c) ((unsigned char)c)
999 #define __Pyx_long_cast(x) ((long)x)
1000 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1001  (sizeof(type) < sizeof(Py_ssize_t)) ||\
1002  (sizeof(type) > sizeof(Py_ssize_t) &&\
1003  likely(v < (type)PY_SSIZE_T_MAX ||\
1004  v == (type)PY_SSIZE_T_MAX) &&\
1005  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1006  v == (type)PY_SSIZE_T_MIN))) ||\
1007  (sizeof(type) == sizeof(Py_ssize_t) &&\
1008  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1009  v == (type)PY_SSIZE_T_MAX))) )
1010 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1011  return (size_t) i < (size_t) limit;
1012 }
1013 #if defined (__cplusplus) && __cplusplus >= 201103L
1014  #include <cstdlib>
1015  #define __Pyx_sst_abs(value) std::abs(value)
1016 #elif SIZEOF_INT >= SIZEOF_SIZE_T
1017  #define __Pyx_sst_abs(value) abs(value)
1018 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1019  #define __Pyx_sst_abs(value) labs(value)
1020 #elif defined (_MSC_VER)
1021  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1022 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1023  #define __Pyx_sst_abs(value) llabs(value)
1024 #elif defined (__GNUC__)
1025  #define __Pyx_sst_abs(value) __builtin_llabs(value)
1026 #else
1027  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1028 #endif
1029 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1030 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1031 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
1032 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1033 #define __Pyx_PyBytes_FromString PyBytes_FromString
1034 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1035 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1036 #if PY_MAJOR_VERSION < 3
1037  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1038  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1039 #else
1040  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1041  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1042 #endif
1043 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1044 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1045 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1046 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1047 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1048 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1049 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
1050 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
1051 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
1052 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1053 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1054 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1055 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1056 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1057 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1058 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1059 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
1060  const Py_UNICODE *u_end = u;
1061  while (*u_end++) ;
1062  return (size_t)(u_end - u - 1);
1063 }
1064 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1065 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1066 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1067 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1068 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1069 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1070 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1071 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1072 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1073 #define __Pyx_PySequence_Tuple(obj)\
1074  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1075 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1076 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1077 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1078 #if CYTHON_ASSUME_SAFE_MACROS
1079 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1080 #else
1081 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1082 #endif
1083 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1084 #if PY_MAJOR_VERSION >= 3
1085 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1086 #else
1087 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1088 #endif
1089 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1090 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1091 static int __Pyx_sys_getdefaultencoding_not_ascii;
1092 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1093  PyObject* sys;
1094  PyObject* default_encoding = NULL;
1095  PyObject* ascii_chars_u = NULL;
1096  PyObject* ascii_chars_b = NULL;
1097  const char* default_encoding_c;
1098  sys = PyImport_ImportModule("sys");
1099  if (!sys) goto bad;
1100  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1101  Py_DECREF(sys);
1102  if (!default_encoding) goto bad;
1103  default_encoding_c = PyBytes_AsString(default_encoding);
1104  if (!default_encoding_c) goto bad;
1105  if (strcmp(default_encoding_c, "ascii") == 0) {
1106  __Pyx_sys_getdefaultencoding_not_ascii = 0;
1107  } else {
1108  char ascii_chars[128];
1109  int c;
1110  for (c = 0; c < 128; c++) {
1111  ascii_chars[c] = c;
1112  }
1113  __Pyx_sys_getdefaultencoding_not_ascii = 1;
1114  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1115  if (!ascii_chars_u) goto bad;
1116  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1117  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1118  PyErr_Format(
1119  PyExc_ValueError,
1120  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1121  default_encoding_c);
1122  goto bad;
1123  }
1124  Py_DECREF(ascii_chars_u);
1125  Py_DECREF(ascii_chars_b);
1126  }
1127  Py_DECREF(default_encoding);
1128  return 0;
1129 bad:
1130  Py_XDECREF(default_encoding);
1131  Py_XDECREF(ascii_chars_u);
1132  Py_XDECREF(ascii_chars_b);
1133  return -1;
1134 }
1135 #endif
1136 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1137 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1138 #else
1139 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1140 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1141 static char* __PYX_DEFAULT_STRING_ENCODING;
1142 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1143  PyObject* sys;
1144  PyObject* default_encoding = NULL;
1145  char* default_encoding_c;
1146  sys = PyImport_ImportModule("sys");
1147  if (!sys) goto bad;
1148  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1149  Py_DECREF(sys);
1150  if (!default_encoding) goto bad;
1151  default_encoding_c = PyBytes_AsString(default_encoding);
1152  if (!default_encoding_c) goto bad;
1153  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1154  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1155  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1156  Py_DECREF(default_encoding);
1157  return 0;
1158 bad:
1159  Py_XDECREF(default_encoding);
1160  return -1;
1161 }
1162 #endif
1163 #endif
1164 
1165 
1166 /* Test for GCC > 2.95 */
1167 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1168  #define likely(x) __builtin_expect(!!(x), 1)
1169  #define unlikely(x) __builtin_expect(!!(x), 0)
1170 #else /* !__GNUC__ or GCC < 2.95 */
1171  #define likely(x) (x)
1172  #define unlikely(x) (x)
1173 #endif /* __GNUC__ */
1174 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1175 
1176 static PyObject *__pyx_m = NULL;
1177 static PyObject *__pyx_d;
1178 static PyObject *__pyx_b;
1179 static PyObject *__pyx_cython_runtime = NULL;
1180 static PyObject *__pyx_empty_tuple;
1181 static PyObject *__pyx_empty_bytes;
1182 static PyObject *__pyx_empty_unicode;
1183 static int __pyx_lineno;
1184 static int __pyx_clineno = 0;
1185 static const char * __pyx_cfilenm= __FILE__;
1186 static const char *__pyx_filename;
1187 
1188 /* Header.proto */
1189 #if !defined(CYTHON_CCOMPLEX)
1190  #if defined(__cplusplus)
1191  #define CYTHON_CCOMPLEX 1
1192  #elif defined(_Complex_I)
1193  #define CYTHON_CCOMPLEX 1
1194  #else
1195  #define CYTHON_CCOMPLEX 0
1196  #endif
1197 #endif
1198 #if CYTHON_CCOMPLEX
1199  #ifdef __cplusplus
1200  #include <complex>
1201  #else
1202  #include <complex.h>
1203  #endif
1204 #endif
1205 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1206  #undef _Complex_I
1207  #define _Complex_I 1.0fj
1208 #endif
1209 
1210 
1211 static const char *__pyx_f[] = {
1212  "imate/_c_trace_estimator/py_c_trace_estimator.pyx",
1213  "imate/_c_trace_estimator/lapack_api.pxi",
1214  "stringsource",
1215  "imate/functions/py_functions.pxd",
1216  "imate/_c_linear_operator/py_c_linear_operator.pxd",
1217  "imate/_c_linear_operator/py_c_matrix.pxd",
1218  "imate/_c_linear_operator/py_c_affine_matrix_function.pxd",
1219 };
1220 /* MemviewSliceStruct.proto */
1221 struct __pyx_memoryview_obj;
1222 typedef struct {
1223  struct __pyx_memoryview_obj *memview;
1224  char *data;
1225  Py_ssize_t shape[8];
1226  Py_ssize_t strides[8];
1227  Py_ssize_t suboffsets[8];
1228 } __Pyx_memviewslice;
1229 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1230 
1231 /* Atomics.proto */
1232 #include <pythread.h>
1233 #ifndef CYTHON_ATOMICS
1234  #define CYTHON_ATOMICS 1
1235 #endif
1236 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1237 #define __pyx_atomic_int_type int
1238 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1239  (__GNUC_MINOR__ > 1 ||\
1240  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1241  #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1242  #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1243  #ifdef __PYX_DEBUG_ATOMICS
1244  #warning "Using GNU atomics"
1245  #endif
1246 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1247  #include <intrin.h>
1248  #undef __pyx_atomic_int_type
1249  #define __pyx_atomic_int_type long
1250  #pragma intrinsic (_InterlockedExchangeAdd)
1251  #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1252  #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1253  #ifdef __PYX_DEBUG_ATOMICS
1254  #pragma message ("Using MSVC atomics")
1255  #endif
1256 #else
1257  #undef CYTHON_ATOMICS
1258  #define CYTHON_ATOMICS 0
1259  #ifdef __PYX_DEBUG_ATOMICS
1260  #warning "Not using atomics"
1261  #endif
1262 #endif
1263 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1264 #if CYTHON_ATOMICS
1265  #define __pyx_add_acquisition_count(memview)\
1266  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1267  #define __pyx_sub_acquisition_count(memview)\
1268  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1269 #else
1270  #define __pyx_add_acquisition_count(memview)\
1271  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1272  #define __pyx_sub_acquisition_count(memview)\
1273  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1274 #endif
1275 
1276 /* ForceInitThreads.proto */
1277 #ifndef __PYX_FORCE_INIT_THREADS
1278  #define __PYX_FORCE_INIT_THREADS 0
1279 #endif
1280 
1281 /* NoFastGil.proto */
1282 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1283 #define __Pyx_PyGILState_Release PyGILState_Release
1284 #define __Pyx_FastGIL_Remember()
1285 #define __Pyx_FastGIL_Forget()
1286 #define __Pyx_FastGilFuncInit()
1287 
1288 /* BufferFormatStructs.proto */
1289 #define IS_UNSIGNED(type) (((type) -1) > 0)
1290 struct __Pyx_StructField_;
1291 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1292 typedef struct {
1293  const char* name;
1294  struct __Pyx_StructField_* fields;
1295  size_t size;
1296  size_t arraysize[8];
1297  int ndim;
1298  char typegroup;
1299  char is_unsigned;
1300  int flags;
1301 } __Pyx_TypeInfo;
1302 typedef struct __Pyx_StructField_ {
1303  __Pyx_TypeInfo* type;
1304  const char* name;
1305  size_t offset;
1306 } __Pyx_StructField;
1307 typedef struct {
1308  __Pyx_StructField* field;
1309  size_t parent_offset;
1310 } __Pyx_BufFmt_StackElem;
1311 typedef struct {
1312  __Pyx_StructField root;
1313  __Pyx_BufFmt_StackElem* head;
1314  size_t fmt_offset;
1315  size_t new_count, enc_count;
1316  size_t struct_alignment;
1317  int is_complex;
1318  char enc_type;
1319  char new_packmode;
1320  char enc_packmode;
1321  char is_valid_array;
1322 } __Pyx_BufFmt_Context;
1323 
1324 
1325 /* "_definitions/types.pxd":97
1326  * ctypedef unsigned int[:] MemoryViewLongIndexType
1327  * ELSE:
1328  * ctypedef int LongIndexType # <<<<<<<<<<<<<<
1329  * ctypedef const int ConstLongIndexType
1330  * ctypedef int[:] MemoryViewLongIndexType
1331  */
1332 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1333 
1334 /* "_definitions/types.pxd":98
1335  * ELSE:
1336  * ctypedef int LongIndexType
1337  * ctypedef const int ConstLongIndexType # <<<<<<<<<<<<<<
1338  * ctypedef int[:] MemoryViewLongIndexType
1339  *
1340  */
1341 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1342 
1343 /* "_definitions/types.pxd":102
1344  *
1345  * # Used for indices of small matrices, or small size iterators
1346  * ctypedef int IndexType # <<<<<<<<<<<<<<
1347  * ctypedef const int ConstIndexType
1348  * ctypedef int[:] MemoryViewIndexType
1349  */
1350 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1351 
1352 /* "_definitions/types.pxd":103
1353  * # Used for indices of small matrices, or small size iterators
1354  * ctypedef int IndexType
1355  * ctypedef const int ConstIndexType # <<<<<<<<<<<<<<
1356  * ctypedef int[:] MemoryViewIndexType
1357  *
1358  */
1359 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1360 
1361 /* "_definitions/types.pxd":107
1362  *
1363  * # Used for both flags and integers used as signals, including negative integers
1364  * ctypedef int FlagType # <<<<<<<<<<<<<<
1365  * ctypedef const int ConstFlagType
1366  * ctypedef int[:] MemoryViewFlagType
1367  */
1368 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1369 
1370 /* "_definitions/types.pxd":108
1371  * # Used for both flags and integers used as signals, including negative integers
1372  * ctypedef int FlagType
1373  * ctypedef const int ConstFlagType # <<<<<<<<<<<<<<
1374  * ctypedef int[:] MemoryViewFlagType
1375  *
1376  */
1377 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1378 
1379 /* "scipy/linalg/cython_lapack.pxd":15
1380  * # The original libraries should be linked directly.
1381  *
1382  * ctypedef float s # <<<<<<<<<<<<<<
1383  * ctypedef double d
1384  * ctypedef float complex c
1385  */
1386 typedef float __pyx_t_5scipy_6linalg_13cython_lapack_s;
1387 
1388 /* "scipy/linalg/cython_lapack.pxd":16
1389  *
1390  * ctypedef float s
1391  * ctypedef double d # <<<<<<<<<<<<<<
1392  * ctypedef float complex c
1393  * ctypedef double complex z
1394  */
1395 typedef double __pyx_t_5scipy_6linalg_13cython_lapack_d;
1396 
1397 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":31
1398  *
1399  * # To avoid cython's bug that does not recognizes "long double" in template []
1400  * ctypedef long double long_double # <<<<<<<<<<<<<<
1401  *
1402  *
1403  */
1404 typedef long double __pyx_t_5imate_18_c_trace_estimator_20py_c_trace_estimator_long_double;
1405 /* Declarations.proto */
1406 #if CYTHON_CCOMPLEX
1407  #ifdef __cplusplus
1408  typedef ::std::complex< float > __pyx_t_float_complex;
1409  #else
1410  typedef float _Complex __pyx_t_float_complex;
1411  #endif
1412 #else
1413  typedef struct { float real, imag; } __pyx_t_float_complex;
1414 #endif
1415 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1416 
1417 /* Declarations.proto */
1418 #if CYTHON_CCOMPLEX
1419  #ifdef __cplusplus
1420  typedef ::std::complex< double > __pyx_t_double_complex;
1421  #else
1422  typedef double _Complex __pyx_t_double_complex;
1423  #endif
1424 #else
1425  typedef struct { double real, imag; } __pyx_t_double_complex;
1426 #endif
1427 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1428 
1429 
1430 /*--- Type declarations ---*/
1431 struct __pyx_obj_5imate_9functions_12py_functions_pyFunction;
1432 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1433 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1434 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1435 struct __pyx_array_obj;
1436 struct __pyx_MemviewEnum_obj;
1437 struct __pyx_memoryview_obj;
1438 struct __pyx_memoryviewslice_obj;
1439 
1440 /* "_definitions/types.pxd":99
1441  * ctypedef int LongIndexType
1442  * ctypedef const int ConstLongIndexType
1443  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1444  *
1445  * # Used for indices of small matrices, or small size iterators
1446  */
1447 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1448 
1449 /* "_definitions/types.pxd":104
1450  * ctypedef int IndexType
1451  * ctypedef const int ConstIndexType
1452  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1453  *
1454  * # Used for both flags and integers used as signals, including negative integers
1455  */
1456 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1457 
1458 /* "_definitions/types.pxd":109
1459  * ctypedef int FlagType
1460  * ctypedef const int ConstFlagType
1461  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1462  *
1463  *
1464  */
1465 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1466 
1467 /* "_definitions/types.pxd":116
1468  * # ==============
1469  *
1470  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1471  * const double x,
1472  * const double kernel_param) nogil
1473  */
1474 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1475 
1476 /* "scipy/linalg/cython_lapack.pxd":22
1477  * # Function pointer type declarations for
1478  * # gees and gges families of functions.
1479  * ctypedef bint cselect1(c*) # <<<<<<<<<<<<<<
1480  * ctypedef bint cselect2(c*, c*)
1481  * ctypedef bint dselect2(d*, d*)
1482  */
1483 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect1(__pyx_t_float_complex *);
1484 
1485 /* "scipy/linalg/cython_lapack.pxd":23
1486  * # gees and gges families of functions.
1487  * ctypedef bint cselect1(c*)
1488  * ctypedef bint cselect2(c*, c*) # <<<<<<<<<<<<<<
1489  * ctypedef bint dselect2(d*, d*)
1490  * ctypedef bint dselect3(d*, d*, d*)
1491  */
1492 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect2(__pyx_t_float_complex *, __pyx_t_float_complex *);
1493 
1494 /* "scipy/linalg/cython_lapack.pxd":24
1495  * ctypedef bint cselect1(c*)
1496  * ctypedef bint cselect2(c*, c*)
1497  * ctypedef bint dselect2(d*, d*) # <<<<<<<<<<<<<<
1498  * ctypedef bint dselect3(d*, d*, d*)
1499  * ctypedef bint sselect2(s*, s*)
1500  */
1501 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect2(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1502 
1503 /* "scipy/linalg/cython_lapack.pxd":25
1504  * ctypedef bint cselect2(c*, c*)
1505  * ctypedef bint dselect2(d*, d*)
1506  * ctypedef bint dselect3(d*, d*, d*) # <<<<<<<<<<<<<<
1507  * ctypedef bint sselect2(s*, s*)
1508  * ctypedef bint sselect3(s*, s*, s*)
1509  */
1510 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect3(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1511 
1512 /* "scipy/linalg/cython_lapack.pxd":26
1513  * ctypedef bint dselect2(d*, d*)
1514  * ctypedef bint dselect3(d*, d*, d*)
1515  * ctypedef bint sselect2(s*, s*) # <<<<<<<<<<<<<<
1516  * ctypedef bint sselect3(s*, s*, s*)
1517  * ctypedef bint zselect1(z*)
1518  */
1519 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect2(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1520 
1521 /* "scipy/linalg/cython_lapack.pxd":27
1522  * ctypedef bint dselect3(d*, d*, d*)
1523  * ctypedef bint sselect2(s*, s*)
1524  * ctypedef bint sselect3(s*, s*, s*) # <<<<<<<<<<<<<<
1525  * ctypedef bint zselect1(z*)
1526  * ctypedef bint zselect2(z*, z*)
1527  */
1528 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect3(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1529 
1530 /* "scipy/linalg/cython_lapack.pxd":28
1531  * ctypedef bint sselect2(s*, s*)
1532  * ctypedef bint sselect3(s*, s*, s*)
1533  * ctypedef bint zselect1(z*) # <<<<<<<<<<<<<<
1534  * ctypedef bint zselect2(z*, z*)
1535  *
1536  */
1537 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect1(__pyx_t_double_complex *);
1538 
1539 /* "scipy/linalg/cython_lapack.pxd":29
1540  * ctypedef bint sselect3(s*, s*, s*)
1541  * ctypedef bint zselect1(z*)
1542  * ctypedef bint zselect2(z*, z*) # <<<<<<<<<<<<<<
1543  *
1544  * cdef void cbbcsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, int *m, int *p, int *q, s *theta, s *phi, c *u1, int *ldu1, c *u2, int *ldu2, c *v1t, int *ldv1t, c *v2t, int *ldv2t, s *b11d, s *b11e, s *b12d, s *b12e, s *b21d, s *b21e, s *b22d, s *b22e, s *rwork, int *lrwork, int *info) noexcept nogil
1545  */
1546 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect2(__pyx_t_double_complex *, __pyx_t_double_complex *);
1547 
1548 /* "imate/functions/py_functions.pxd":20
1549  * # ============
1550  *
1551  * cdef class pyFunction(object): # <<<<<<<<<<<<<<
1552  *
1553  * # Member data
1554  */
1555 struct __pyx_obj_5imate_9functions_12py_functions_pyFunction {
1556  PyObject_HEAD
1557  struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *__pyx_vtab;
1558  Function *matrix_function;
1559 };
1560 
1561 
1562 /* "imate/_c_linear_operator/py_c_linear_operator.pxd":23
1563  * # ===================
1564  *
1565  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1566  *
1567  * # Attributes
1568  */
1569 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1570  PyObject_HEAD
1571  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1572  cLinearOperator<float> *Aop_float;
1573  cLinearOperator<double> *Aop_double;
1574  cLinearOperator<long double> *Aop_long_double;
1575  char *data_type_name;
1576  char *long_index_type_name;
1577  __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1578  PyObject *parameters;
1579 };
1580 
1581 
1582 /* "imate/_c_linear_operator/py_c_matrix.pxd":21
1583  * # =========
1584  *
1585  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1586  * cdef A_csr
1587  * cdef A_indices_copy
1588  */
1589 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1590  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1591  PyObject *A_csr;
1592  PyObject *A_indices_copy;
1593  PyObject *A_index_pointer_copy;
1594 };
1595 
1596 
1597 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pxd":21
1598  * # ==========================
1599  *
1600  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1601  * cdef A_csr
1602  * cdef B_csr
1603  */
1604 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1605  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1606  PyObject *A_csr;
1607  PyObject *B_csr;
1608  PyObject *A_indices_copy;
1609  PyObject *A_index_pointer_copy;
1610  PyObject *B_indices_copy;
1611  PyObject *B_index_pointer_copy;
1612 };
1613 
1614 
1615 /* "View.MemoryView":106
1616  *
1617  * @cname("__pyx_array")
1618  * cdef class array: # <<<<<<<<<<<<<<
1619  *
1620  * cdef:
1621  */
1622 struct __pyx_array_obj {
1623  PyObject_HEAD
1624  struct __pyx_vtabstruct_array *__pyx_vtab;
1625  char *data;
1626  Py_ssize_t len;
1627  char *format;
1628  int ndim;
1629  Py_ssize_t *_shape;
1630  Py_ssize_t *_strides;
1631  Py_ssize_t itemsize;
1632  PyObject *mode;
1633  PyObject *_format;
1634  void (*callback_free_data)(void *);
1635  int free_data;
1636  int dtype_is_object;
1637 };
1638 
1639 
1640 /* "View.MemoryView":280
1641  *
1642  * @cname('__pyx_MemviewEnum')
1643  * cdef class Enum(object): # <<<<<<<<<<<<<<
1644  * cdef object name
1645  * def __init__(self, name):
1646  */
1647 struct __pyx_MemviewEnum_obj {
1648  PyObject_HEAD
1649  PyObject *name;
1650 };
1651 
1652 
1653 /* "View.MemoryView":331
1654  *
1655  * @cname('__pyx_memoryview')
1656  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1657  *
1658  * cdef object obj
1659  */
1660 struct __pyx_memoryview_obj {
1661  PyObject_HEAD
1662  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1663  PyObject *obj;
1664  PyObject *_size;
1665  PyObject *_array_interface;
1666  PyThread_type_lock lock;
1667  __pyx_atomic_int acquisition_count[2];
1668  __pyx_atomic_int *acquisition_count_aligned_p;
1669  Py_buffer view;
1670  int flags;
1671  int dtype_is_object;
1672  __Pyx_TypeInfo *typeinfo;
1673 };
1674 
1675 
1676 /* "View.MemoryView":967
1677  *
1678  * @cname('__pyx_memoryviewslice')
1679  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1680  * "Internal class for passing memoryview slices to Python"
1681  *
1682  */
1683 struct __pyx_memoryviewslice_obj {
1684  struct __pyx_memoryview_obj __pyx_base;
1685  __Pyx_memviewslice from_slice;
1686  PyObject *from_object;
1687  PyObject *(*to_object_func)(char *);
1688  int (*to_dtype_func)(char *, PyObject *);
1689 };
1690 
1691 
1692 
1693 /* "imate/functions/py_functions.pxd":20
1694  * # ============
1695  *
1696  * cdef class pyFunction(object): # <<<<<<<<<<<<<<
1697  *
1698  * # Member data
1699  */
1700 
1701 struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction {
1702  void (*set_function)(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, Function *);
1703  Function *(*get_function)(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *);
1704 };
1705 static struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *__pyx_vtabptr_5imate_9functions_12py_functions_pyFunction;
1706 
1707 
1708 /* "imate/_c_linear_operator/py_c_linear_operator.pxd":23
1709  * # ===================
1710  *
1711  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1712  *
1713  * # Attributes
1714  */
1715 
1716 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1717  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1718  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1719  cLinearOperator<float> *(*get_linear_operator_float)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1720  cLinearOperator<double> *(*get_linear_operator_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1721  cLinearOperator<long double> *(*get_linear_operator_long_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1722  void (*dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1723  void (*transpose_dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1724 };
1725 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1726 
1727 
1728 /* "imate/_c_linear_operator/py_c_matrix.pxd":21
1729  * # =========
1730  *
1731  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1732  * cdef A_csr
1733  * cdef A_indices_copy
1734  */
1735 
1736 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1737  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1738 };
1739 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1740 
1741 
1742 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pxd":21
1743  * # ==========================
1744  *
1745  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1746  * cdef A_csr
1747  * cdef B_csr
1748  */
1749 
1750 struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1751  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1752 };
1753 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1754 
1755 
1756 /* "View.MemoryView":106
1757  *
1758  * @cname("__pyx_array")
1759  * cdef class array: # <<<<<<<<<<<<<<
1760  *
1761  * cdef:
1762  */
1763 
1764 struct __pyx_vtabstruct_array {
1765  PyObject *(*get_memview)(struct __pyx_array_obj *);
1766 };
1767 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1768 
1769 
1770 /* "View.MemoryView":331
1771  *
1772  * @cname('__pyx_memoryview')
1773  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1774  *
1775  * cdef object obj
1776  */
1777 
1778 struct __pyx_vtabstruct_memoryview {
1779  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1780  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1781  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1782  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1783  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1784  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1785  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1786 };
1787 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1788 
1789 
1790 /* "View.MemoryView":967
1791  *
1792  * @cname('__pyx_memoryviewslice')
1793  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1794  * "Internal class for passing memoryview slices to Python"
1795  *
1796  */
1797 
1798 struct __pyx_vtabstruct__memoryviewslice {
1799  struct __pyx_vtabstruct_memoryview __pyx_base;
1800 };
1801 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1802 
1803 /* --- Runtime support code (head) --- */
1804 /* Refnanny.proto */
1805 #ifndef CYTHON_REFNANNY
1806  #define CYTHON_REFNANNY 0
1807 #endif
1808 #if CYTHON_REFNANNY
1809  typedef struct {
1810  void (*INCREF)(void*, PyObject*, int);
1811  void (*DECREF)(void*, PyObject*, int);
1812  void (*GOTREF)(void*, PyObject*, int);
1813  void (*GIVEREF)(void*, PyObject*, int);
1814  void* (*SetupContext)(const char*, int, const char*);
1815  void (*FinishContext)(void**);
1816  } __Pyx_RefNannyAPIStruct;
1817  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1818  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1819  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1820 #ifdef WITH_THREAD
1821  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1822  if (acquire_gil) {\
1823  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1824  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1825  PyGILState_Release(__pyx_gilstate_save);\
1826  } else {\
1827  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1828  }
1829 #else
1830  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1831  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1832 #endif
1833  #define __Pyx_RefNannyFinishContext()\
1834  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1835  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1836  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1837  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1838  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1839  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1840  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1841  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1842  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1843 #else
1844  #define __Pyx_RefNannyDeclarations
1845  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1846  #define __Pyx_RefNannyFinishContext()
1847  #define __Pyx_INCREF(r) Py_INCREF(r)
1848  #define __Pyx_DECREF(r) Py_DECREF(r)
1849  #define __Pyx_GOTREF(r)
1850  #define __Pyx_GIVEREF(r)
1851  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1852  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1853  #define __Pyx_XGOTREF(r)
1854  #define __Pyx_XGIVEREF(r)
1855 #endif
1856 #define __Pyx_XDECREF_SET(r, v) do {\
1857  PyObject *tmp = (PyObject *) r;\
1858  r = v; __Pyx_XDECREF(tmp);\
1859  } while (0)
1860 #define __Pyx_DECREF_SET(r, v) do {\
1861  PyObject *tmp = (PyObject *) r;\
1862  r = v; __Pyx_DECREF(tmp);\
1863  } while (0)
1864 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1865 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1866 
1867 /* PyObjectGetAttrStr.proto */
1868 #if CYTHON_USE_TYPE_SLOTS
1869 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1870 #else
1871 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1872 #endif
1873 
1874 /* GetBuiltinName.proto */
1875 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1876 
1877 /* PyThreadStateGet.proto */
1878 #if CYTHON_FAST_THREAD_STATE
1879 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1880 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1881 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1882 #else
1883 #define __Pyx_PyThreadState_declare
1884 #define __Pyx_PyThreadState_assign
1885 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1886 #endif
1887 
1888 /* PyErrFetchRestore.proto */
1889 #if CYTHON_FAST_THREAD_STATE
1890 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1891 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1892 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1893 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1894 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1895 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1896 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1897 #if CYTHON_COMPILING_IN_CPYTHON
1898 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1899 #else
1900 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1901 #endif
1902 #else
1903 #define __Pyx_PyErr_Clear() PyErr_Clear()
1904 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1905 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1906 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1907 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1908 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1909 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1910 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1911 #endif
1912 
1913 /* Profile.proto */
1914 #ifndef CYTHON_PROFILE
1915 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1916  #define CYTHON_PROFILE 0
1917 #else
1918  #define CYTHON_PROFILE 1
1919 #endif
1920 #endif
1921 #ifndef CYTHON_TRACE_NOGIL
1922  #define CYTHON_TRACE_NOGIL 0
1923 #else
1924  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1925  #define CYTHON_TRACE 1
1926  #endif
1927 #endif
1928 #ifndef CYTHON_TRACE
1929  #define CYTHON_TRACE 0
1930 #endif
1931 #if CYTHON_TRACE
1932  #undef CYTHON_PROFILE_REUSE_FRAME
1933 #endif
1934 #ifndef CYTHON_PROFILE_REUSE_FRAME
1935  #define CYTHON_PROFILE_REUSE_FRAME 0
1936 #endif
1937 #if CYTHON_PROFILE || CYTHON_TRACE
1938  #include "compile.h"
1939  #include "frameobject.h"
1940  #include "traceback.h"
1941 #if PY_VERSION_HEX >= 0x030b00a6
1942  #ifndef Py_BUILD_CORE
1943  #define Py_BUILD_CORE 1
1944  #endif
1945  #include "internal/pycore_frame.h"
1946 #endif
1947  #if CYTHON_PROFILE_REUSE_FRAME
1948  #define CYTHON_FRAME_MODIFIER static
1949  #define CYTHON_FRAME_DEL(frame)
1950  #else
1951  #define CYTHON_FRAME_MODIFIER
1952  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1953  #endif
1954  #define __Pyx_TraceDeclarations\
1955  static PyCodeObject *__pyx_frame_code = NULL;\
1956  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1957  int __Pyx_use_tracing = 0;
1958  #define __Pyx_TraceFrameInit(codeobj)\
1959  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1960 #if PY_VERSION_HEX >= 0x030b00a2
1961  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1962  (unlikely((tstate)->cframe->use_tracing) &&\
1963  (!(check_tracing) || !(tstate)->tracing) &&\
1964  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1965  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1966  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1967 #elif PY_VERSION_HEX >= 0x030a00b1
1968  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1969  (unlikely((tstate)->cframe->use_tracing) &&\
1970  (!(check_tracing) || !(tstate)->tracing) &&\
1971  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1972  #define __Pyx_EnterTracing(tstate)\
1973  do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1974  #define __Pyx_LeaveTracing(tstate)\
1975  do {\
1976  tstate->tracing--;\
1977  tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1978  || tstate->c_profilefunc != NULL);\
1979  } while (0)
1980 #else
1981  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1982  (unlikely((tstate)->use_tracing) &&\
1983  (!(check_tracing) || !(tstate)->tracing) &&\
1984  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1985  #define __Pyx_EnterTracing(tstate)\
1986  do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1987  #define __Pyx_LeaveTracing(tstate)\
1988  do {\
1989  tstate->tracing--;\
1990  tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1991  || tstate->c_profilefunc != NULL);\
1992  } while (0)
1993 #endif
1994  #ifdef WITH_THREAD
1995  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1996  if (nogil) {\
1997  if (CYTHON_TRACE_NOGIL) {\
1998  PyThreadState *tstate;\
1999  PyGILState_STATE state = PyGILState_Ensure();\
2000  tstate = __Pyx_PyThreadState_Current;\
2001  if (__Pyx_IsTracing(tstate, 1, 1)) {\
2002  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
2003  }\
2004  PyGILState_Release(state);\
2005  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
2006  }\
2007  } else {\
2008  PyThreadState* tstate = PyThreadState_GET();\
2009  if (__Pyx_IsTracing(tstate, 1, 1)) {\
2010  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
2011  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
2012  }\
2013  }
2014  #else
2015  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
2016  { PyThreadState* tstate = PyThreadState_GET();\
2017  if (__Pyx_IsTracing(tstate, 1, 1)) {\
2018  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
2019  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
2020  }\
2021  }
2022  #endif
2023  #define __Pyx_TraceException()\
2024  if (likely(!__Pyx_use_tracing)); else {\
2025  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2026  if (__Pyx_IsTracing(tstate, 0, 1)) {\
2027  __Pyx_EnterTracing(tstate);\
2028  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
2029  if (exc_info) {\
2030  if (CYTHON_TRACE && tstate->c_tracefunc)\
2031  tstate->c_tracefunc(\
2032  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
2033  tstate->c_profilefunc(\
2034  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
2035  Py_DECREF(exc_info);\
2036  }\
2037  __Pyx_LeaveTracing(tstate);\
2038  }\
2039  }
2040  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
2041  PyObject *type, *value, *traceback;
2042  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
2043  __Pyx_EnterTracing(tstate);
2044  if (CYTHON_TRACE && tstate->c_tracefunc)
2045  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
2046  if (tstate->c_profilefunc)
2047  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
2048  CYTHON_FRAME_DEL(frame);
2049  __Pyx_LeaveTracing(tstate);
2050  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
2051  }
2052  #ifdef WITH_THREAD
2053  #define __Pyx_TraceReturn(result, nogil)\
2054  if (likely(!__Pyx_use_tracing)); else {\
2055  if (nogil) {\
2056  if (CYTHON_TRACE_NOGIL) {\
2057  PyThreadState *tstate;\
2058  PyGILState_STATE state = PyGILState_Ensure();\
2059  tstate = __Pyx_PyThreadState_Current;\
2060  if (__Pyx_IsTracing(tstate, 0, 0)) {\
2061  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
2062  }\
2063  PyGILState_Release(state);\
2064  }\
2065  } else {\
2066  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2067  if (__Pyx_IsTracing(tstate, 0, 0)) {\
2068  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
2069  }\
2070  }\
2071  }
2072  #else
2073  #define __Pyx_TraceReturn(result, nogil)\
2074  if (likely(!__Pyx_use_tracing)); else {\
2075  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2076  if (__Pyx_IsTracing(tstate, 0, 0)) {\
2077  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
2078  }\
2079  }
2080  #endif
2081  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
2082  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
2083 #else
2084  #define __Pyx_TraceDeclarations
2085  #define __Pyx_TraceFrameInit(codeobj)
2086  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
2087  #define __Pyx_TraceException()
2088  #define __Pyx_TraceReturn(result, nogil)
2089 #endif
2090 #if CYTHON_TRACE
2091  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
2092  int ret;
2093  PyObject *type, *value, *traceback;
2094  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
2095  __Pyx_PyFrame_SetLineNumber(frame, lineno);
2096  __Pyx_EnterTracing(tstate);
2097  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
2098  __Pyx_LeaveTracing(tstate);
2099  if (likely(!ret)) {
2100  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
2101  } else {
2102  Py_XDECREF(type);
2103  Py_XDECREF(value);
2104  Py_XDECREF(traceback);
2105  }
2106  return ret;
2107  }
2108  #ifdef WITH_THREAD
2109  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
2110  if (likely(!__Pyx_use_tracing)); else {\
2111  if (nogil) {\
2112  if (CYTHON_TRACE_NOGIL) {\
2113  int ret = 0;\
2114  PyThreadState *tstate;\
2115  PyGILState_STATE state = PyGILState_Ensure();\
2116  tstate = __Pyx_PyThreadState_Current;\
2117  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2118  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2119  }\
2120  PyGILState_Release(state);\
2121  if (unlikely(ret)) goto_error;\
2122  }\
2123  } else {\
2124  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2125  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2126  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2127  if (unlikely(ret)) goto_error;\
2128  }\
2129  }\
2130  }
2131  #else
2132  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
2133  if (likely(!__Pyx_use_tracing)); else {\
2134  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2135  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2136  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2137  if (unlikely(ret)) goto_error;\
2138  }\
2139  }
2140  #endif
2141 #else
2142  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
2143 #endif
2144 
2145 /* WriteUnraisableException.proto */
2146 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2147  int lineno, const char *filename,
2148  int full_traceback, int nogil);
2149 
2150 /* IncludeStringH.proto */
2151 #include <string.h>
2152 
2153 /* BytesEquals.proto */
2154 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2155 
2156 /* MemviewSliceInit.proto */
2157 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2158 #define __Pyx_MEMVIEW_DIRECT 1
2159 #define __Pyx_MEMVIEW_PTR 2
2160 #define __Pyx_MEMVIEW_FULL 4
2161 #define __Pyx_MEMVIEW_CONTIG 8
2162 #define __Pyx_MEMVIEW_STRIDED 16
2163 #define __Pyx_MEMVIEW_FOLLOW 32
2164 #define __Pyx_IS_C_CONTIG 1
2165 #define __Pyx_IS_F_CONTIG 2
2166 static int __Pyx_init_memviewslice(
2167  struct __pyx_memoryview_obj *memview,
2168  int ndim,
2169  __Pyx_memviewslice *memviewslice,
2170  int memview_is_new_reference);
2171 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2172  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2173 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2174  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2175 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2176 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2177 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2178 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2179 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2180 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2181 
2182 /* PyObjectCall.proto */
2183 #if CYTHON_COMPILING_IN_CPYTHON
2184 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2185 #else
2186 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2187 #endif
2188 
2189 /* RaiseException.proto */
2190 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2191 
2192 /* SetItemInt.proto */
2193 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2194  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2195  __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2196  (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2197  __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2198 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2199 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2200  int is_list, int wraparound, int boundscheck);
2201 
2202 /* RaiseArgTupleInvalid.proto */
2203 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2204  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2205 
2206 /* RaiseDoubleKeywords.proto */
2207 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2208 
2209 /* ParseKeywords.proto */
2210 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
2211  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
2212  const char* function_name);
2213 
2214 /* ArgTypeTest.proto */
2215 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2216  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2217  __Pyx__ArgTypeTest(obj, type, name, exact))
2218 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2219 
2220 /* PyDictVersioning.proto */
2221 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2222 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2223 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2224 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2225  (version_var) = __PYX_GET_DICT_VERSION(dict);\
2226  (cache_var) = (value);
2227 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2228  static PY_UINT64_T __pyx_dict_version = 0;\
2229  static PyObject *__pyx_dict_cached_value = NULL;\
2230  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2231  (VAR) = __pyx_dict_cached_value;\
2232  } else {\
2233  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2234  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2235  }\
2236 }
2237 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2238 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2239 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2240 #else
2241 #define __PYX_GET_DICT_VERSION(dict) (0)
2242 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2243 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2244 #endif
2245 
2246 /* GetModuleGlobalName.proto */
2247 #if CYTHON_USE_DICT_VERSIONS
2248 #define __Pyx_GetModuleGlobalName(var, name) do {\
2249  static PY_UINT64_T __pyx_dict_version = 0;\
2250  static PyObject *__pyx_dict_cached_value = NULL;\
2251  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2252  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2253  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2254 } while(0)
2255 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2256  PY_UINT64_T __pyx_dict_version;\
2257  PyObject *__pyx_dict_cached_value;\
2258  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2259 } while(0)
2260 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2261 #else
2262 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2263 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2264 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2265 #endif
2266 
2267 /* PyCFunctionFastCall.proto */
2268 #if CYTHON_FAST_PYCCALL
2269 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
2270 #else
2271 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
2272 #endif
2273 
2274 /* PyFunctionFastCall.proto */
2275 #if CYTHON_FAST_PYCALL
2276 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2277  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2278 #if 1 || PY_VERSION_HEX < 0x030600B1
2279 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2280 #else
2281 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2282 #endif
2283 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2284  (sizeof(char [1 - 2*!(cond)]) - 1)
2285 #ifndef Py_MEMBER_SIZE
2286 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2287 #endif
2288 #if CYTHON_FAST_PYCALL
2289  static size_t __pyx_pyframe_localsplus_offset = 0;
2290  #include "frameobject.h"
2291 #if PY_VERSION_HEX >= 0x030b00a6
2292  #ifndef Py_BUILD_CORE
2293  #define Py_BUILD_CORE 1
2294  #endif
2295  #include "internal/pycore_frame.h"
2296 #endif
2297  #define __Pxy_PyFrame_Initialize_Offsets()\
2298  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2299  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2300  #define __Pyx_PyFrame_GetLocalsplus(frame)\
2301  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2302 #endif // CYTHON_FAST_PYCALL
2303 #endif
2304 
2305 /* PyObjectCall2Args.proto */
2306 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2307 
2308 /* PyObjectCallMethO.proto */
2309 #if CYTHON_COMPILING_IN_CPYTHON
2310 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2311 #endif
2312 
2313 /* PyObjectCallOneArg.proto */
2314 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2315 
2316 /* UnicodeEquals.proto */
2317 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2318 
2319 /* StrEquals.proto */
2320 #if PY_MAJOR_VERSION >= 3
2321 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2322 #else
2323 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2324 #endif
2325 
2326 /* UnaryNegOverflows.proto */
2327 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2328  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2329 
2330 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2331 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2332 /* GetAttr.proto */
2333 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2334 
2335 /* GetItemInt.proto */
2336 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2337  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2338  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2339  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2340  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2341 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2342  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2343  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2344  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2345 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2346  int wraparound, int boundscheck);
2347 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2348  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2349  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2350  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2351 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2352  int wraparound, int boundscheck);
2353 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2354 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2355  int is_list, int wraparound, int boundscheck);
2356 
2357 /* ObjectGetItem.proto */
2358 #if CYTHON_USE_TYPE_SLOTS
2359 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2360 #else
2361 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2362 #endif
2363 
2364 /* decode_c_string_utf16.proto */
2365 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2366  int byteorder = 0;
2367  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2368 }
2369 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2370  int byteorder = -1;
2371  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2372 }
2373 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2374  int byteorder = 1;
2375  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2376 }
2377 
2378 /* decode_c_string.proto */
2379 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2380  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2381  const char* encoding, const char* errors,
2382  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2383 
2384 /* PyErrExceptionMatches.proto */
2385 #if CYTHON_FAST_THREAD_STATE
2386 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2387 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2388 #else
2389 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2390 #endif
2391 
2392 /* GetAttr3.proto */
2393 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2394 
2395 /* RaiseTooManyValuesToUnpack.proto */
2396 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2397 
2398 /* RaiseNeedMoreValuesToUnpack.proto */
2399 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2400 
2401 /* RaiseNoneIterError.proto */
2402 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2403 
2404 /* ExtTypeTest.proto */
2405 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2406 
2407 /* GetTopmostException.proto */
2408 #if CYTHON_USE_EXC_INFO_STACK
2409 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2410 #endif
2411 
2412 /* SaveResetException.proto */
2413 #if CYTHON_FAST_THREAD_STATE
2414 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2415 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2416 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2417 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2418 #else
2419 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2420 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2421 #endif
2422 
2423 /* GetException.proto */
2424 #if CYTHON_FAST_THREAD_STATE
2425 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2426 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2427 #else
2428 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2429 #endif
2430 
2431 /* SwapException.proto */
2432 #if CYTHON_FAST_THREAD_STATE
2433 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2434 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2435 #else
2436 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2437 #endif
2438 
2439 /* Import.proto */
2440 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2441 
2442 /* FastTypeChecks.proto */
2443 #if CYTHON_COMPILING_IN_CPYTHON
2444 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2445 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2446 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2447 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2448 #else
2449 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2450 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2451 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2452 #endif
2453 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2454 
2455 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2456 /* ListCompAppend.proto */
2457 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2458 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2459  PyListObject* L = (PyListObject*) list;
2460  Py_ssize_t len = Py_SIZE(list);
2461  if (likely(L->allocated > len)) {
2462  Py_INCREF(x);
2463  PyList_SET_ITEM(list, len, x);
2464  __Pyx_SET_SIZE(list, len + 1);
2465  return 0;
2466  }
2467  return PyList_Append(list, x);
2468 }
2469 #else
2470 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2471 #endif
2472 
2473 /* PyIntBinop.proto */
2474 #if !CYTHON_COMPILING_IN_PYPY
2475 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2476 #else
2477 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2478  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2479 #endif
2480 
2481 /* ListExtend.proto */
2482 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2483 #if CYTHON_COMPILING_IN_CPYTHON
2484  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2485  if (unlikely(!none))
2486  return -1;
2487  Py_DECREF(none);
2488  return 0;
2489 #else
2490  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2491 #endif
2492 }
2493 
2494 /* ListAppend.proto */
2495 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2496 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2497  PyListObject* L = (PyListObject*) list;
2498  Py_ssize_t len = Py_SIZE(list);
2499  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2500  Py_INCREF(x);
2501  PyList_SET_ITEM(list, len, x);
2502  __Pyx_SET_SIZE(list, len + 1);
2503  return 0;
2504  }
2505  return PyList_Append(list, x);
2506 }
2507 #else
2508 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2509 #endif
2510 
2511 /* AssertionsEnabled.proto */
2512 #define __Pyx_init_assertions_enabled()
2513 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2514  #define __pyx_assertions_enabled() (1)
2515 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2516  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2517 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2518  static int __pyx_assertions_enabled_flag;
2519  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2520  #undef __Pyx_init_assertions_enabled
2521  static void __Pyx_init_assertions_enabled(void) {
2522  __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2523  }
2524 #else
2525  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2526 #endif
2527 
2528 /* None.proto */
2529 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2530 
2531 /* PySequenceContains.proto */
2532 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2533  int result = PySequence_Contains(seq, item);
2534  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2535 }
2536 
2537 /* ImportFrom.proto */
2538 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2539 
2540 /* HasAttr.proto */
2541 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2542 
2543 /* PyObject_GenericGetAttrNoDict.proto */
2544 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2545 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2546 #else
2547 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2548 #endif
2549 
2550 /* PyObject_GenericGetAttr.proto */
2551 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2552 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2553 #else
2554 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2555 #endif
2556 
2557 /* SetVTable.proto */
2558 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2559 
2560 /* PyObjectGetAttrStrNoError.proto */
2561 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2562 
2563 /* SetupReduce.proto */
2564 static int __Pyx_setup_reduce(PyObject* type_obj);
2565 
2566 /* TypeImport.proto */
2567 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2568 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2569 #if __STDC_VERSION__ >= 201112L
2570 #include <stdalign.h>
2571 #endif
2572 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2573 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2574 #else
2575 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2576 #endif
2577 enum __Pyx_ImportType_CheckSize_0_29_36 {
2578  __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2579  __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2580  __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2581 };
2582 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2583 #endif
2584 
2585 /* GetVTable.proto */
2586 static void* __Pyx_GetVtable(PyObject *dict);
2587 
2588 /* FetchCommonType.proto */
2589 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2590 
2591 /* CythonFunctionShared.proto */
2592 #define __Pyx_CyFunction_USED 1
2593 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2594 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2595 #define __Pyx_CYFUNCTION_CCLASS 0x04
2596 #define __Pyx_CyFunction_GetClosure(f)\
2597  (((__pyx_CyFunctionObject *) (f))->func_closure)
2598 #define __Pyx_CyFunction_GetClassObj(f)\
2599  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2600 #define __Pyx_CyFunction_Defaults(type, f)\
2601  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2602 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2603  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2604 typedef struct {
2605  PyCFunctionObject func;
2606 #if PY_VERSION_HEX < 0x030500A0
2607  PyObject *func_weakreflist;
2608 #endif
2609  PyObject *func_dict;
2610  PyObject *func_name;
2611  PyObject *func_qualname;
2612  PyObject *func_doc;
2613  PyObject *func_globals;
2614  PyObject *func_code;
2615  PyObject *func_closure;
2616  PyObject *func_classobj;
2617  void *defaults;
2618  int defaults_pyobjects;
2619  size_t defaults_size; // used by FusedFunction for copying defaults
2620  int flags;
2621  PyObject *defaults_tuple;
2622  PyObject *defaults_kwdict;
2623  PyObject *(*defaults_getter)(PyObject *);
2624  PyObject *func_annotations;
2625 } __pyx_CyFunctionObject;
2626 static PyTypeObject *__pyx_CyFunctionType = 0;
2627 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2628 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2629  int flags, PyObject* qualname,
2630  PyObject *self,
2631  PyObject *module, PyObject *globals,
2632  PyObject* code);
2633 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2634  size_t size,
2635  int pyobjects);
2636 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2637  PyObject *tuple);
2638 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2639  PyObject *dict);
2640 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2641  PyObject *dict);
2642 static int __pyx_CyFunction_init(void);
2643 
2644 /* CythonFunction.proto */
2645 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2646  int flags, PyObject* qualname,
2647  PyObject *closure,
2648  PyObject *module, PyObject *globals,
2649  PyObject* code);
2650 
2651 /* CLineInTraceback.proto */
2652 #ifdef CYTHON_CLINE_IN_TRACEBACK
2653 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2654 #else
2655 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2656 #endif
2657 
2658 /* CodeObjectCache.proto */
2659 typedef struct {
2660  PyCodeObject* code_object;
2661  int code_line;
2662 } __Pyx_CodeObjectCacheEntry;
2663 struct __Pyx_CodeObjectCache {
2664  int count;
2665  int max_count;
2666  __Pyx_CodeObjectCacheEntry* entries;
2667 };
2668 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2669 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2670 static PyCodeObject *__pyx_find_code_object(int code_line);
2671 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2672 
2673 /* AddTraceback.proto */
2674 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2675  int py_line, const char *filename);
2676 
2677 #if PY_MAJOR_VERSION < 3
2678  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2679  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2680 #else
2681  #define __Pyx_GetBuffer PyObject_GetBuffer
2682  #define __Pyx_ReleaseBuffer PyBuffer_Release
2683 #endif
2684 
2685 
2686 /* BufferStructDeclare.proto */
2687 typedef struct {
2688  Py_ssize_t shape, strides, suboffsets;
2689 } __Pyx_Buf_DimInfo;
2690 typedef struct {
2691  size_t refcount;
2692  Py_buffer pybuffer;
2693 } __Pyx_Buffer;
2694 typedef struct {
2695  __Pyx_Buffer *rcbuffer;
2696  char *data;
2697  __Pyx_Buf_DimInfo diminfo[8];
2698 } __Pyx_LocalBuf_ND;
2699 
2700 /* MemviewSliceIsContig.proto */
2701 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2702 
2703 /* OverlappingSlices.proto */
2704 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2705  __Pyx_memviewslice *slice2,
2706  int ndim, size_t itemsize);
2707 
2708 /* Capsule.proto */
2709 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2710 
2711 /* GCCDiagnostics.proto */
2712 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2713 #define __Pyx_HAS_GCC_DIAGNOSTIC
2714 #endif
2715 
2716 /* IsLittleEndian.proto */
2717 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2718 
2719 /* BufferFormatCheck.proto */
2720 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2721 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2722  __Pyx_BufFmt_StackElem* stack,
2723  __Pyx_TypeInfo* type);
2724 
2725 /* TypeInfoCompare.proto */
2726 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2727 
2728 /* MemviewSliceValidateAndInit.proto */
2729 static int __Pyx_ValidateAndInit_memviewslice(
2730  int *axes_specs,
2731  int c_or_f_flag,
2732  int buf_flags,
2733  int ndim,
2734  __Pyx_TypeInfo *dtype,
2735  __Pyx_BufFmt_StackElem stack[],
2736  __Pyx_memviewslice *memviewslice,
2737  PyObject *original_obj);
2738 
2739 /* ObjectToMemviewSlice.proto */
2740 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2741 
2742 /* ObjectToMemviewSlice.proto */
2743 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag);
2744 
2745 /* ObjectToMemviewSlice.proto */
2746 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2747 
2748 /* ObjectToMemviewSlice.proto */
2749 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2750 
2751 /* ObjectToMemviewSlice.proto */
2752 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2753 
2754 /* ObjectToMemviewSlice.proto */
2755 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *, int writable_flag);
2756 
2757 /* ObjectToMemviewSlice.proto */
2758 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *, int writable_flag);
2759 
2760 /* RealImag.proto */
2761 #if CYTHON_CCOMPLEX
2762  #ifdef __cplusplus
2763  #define __Pyx_CREAL(z) ((z).real())
2764  #define __Pyx_CIMAG(z) ((z).imag())
2765  #else
2766  #define __Pyx_CREAL(z) (__real__(z))
2767  #define __Pyx_CIMAG(z) (__imag__(z))
2768  #endif
2769 #else
2770  #define __Pyx_CREAL(z) ((z).real)
2771  #define __Pyx_CIMAG(z) ((z).imag)
2772 #endif
2773 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2774  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2775  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2776  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2777 #else
2778  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2779  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2780 #endif
2781 
2782 /* Arithmetic.proto */
2783 #if CYTHON_CCOMPLEX
2784  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2785  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2786  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2787  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2788  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2789  #define __Pyx_c_neg_float(a) (-(a))
2790  #ifdef __cplusplus
2791  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2792  #define __Pyx_c_conj_float(z) (::std::conj(z))
2793  #if 1
2794  #define __Pyx_c_abs_float(z) (::std::abs(z))
2795  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2796  #endif
2797  #else
2798  #define __Pyx_c_is_zero_float(z) ((z)==0)
2799  #define __Pyx_c_conj_float(z) (conjf(z))
2800  #if 1
2801  #define __Pyx_c_abs_float(z) (cabsf(z))
2802  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2803  #endif
2804  #endif
2805 #else
2806  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2807  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2808  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2809  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2810  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2811  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2812  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2813  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2814  #if 1
2815  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2816  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2817  #endif
2818 #endif
2819 
2820 /* Arithmetic.proto */
2821 #if CYTHON_CCOMPLEX
2822  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2823  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2824  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2825  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2826  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2827  #define __Pyx_c_neg_double(a) (-(a))
2828  #ifdef __cplusplus
2829  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2830  #define __Pyx_c_conj_double(z) (::std::conj(z))
2831  #if 1
2832  #define __Pyx_c_abs_double(z) (::std::abs(z))
2833  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2834  #endif
2835  #else
2836  #define __Pyx_c_is_zero_double(z) ((z)==0)
2837  #define __Pyx_c_conj_double(z) (conj(z))
2838  #if 1
2839  #define __Pyx_c_abs_double(z) (cabs(z))
2840  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2841  #endif
2842  #endif
2843 #else
2844  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2845  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2846  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2847  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2848  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2849  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2850  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2851  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2852  #if 1
2853  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2854  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2855  #endif
2856 #endif
2857 
2858 /* MemviewSliceCopyTemplate.proto */
2859 static __Pyx_memviewslice
2860 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2861  const char *mode, int ndim,
2862  size_t sizeof_dtype, int contig_flag,
2863  int dtype_is_object);
2864 
2865 /* CIntFromPy.proto */
2866 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2867 
2868 /* CIntToPy.proto */
2869 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2870 
2871 /* CIntToPy.proto */
2872 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2873 
2874 /* CIntFromPy.proto */
2875 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2876 
2877 /* CIntFromPy.proto */
2878 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2879 
2880 /* CheckBinaryVersion.proto */
2881 static int __Pyx_check_binary_version(void);
2882 
2883 /* FunctionExport.proto */
2884 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2885 
2886 /* FunctionImport.proto */
2887 static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2888 
2889 /* InitStrings.proto */
2890 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2891 
2892 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2893 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2894 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2895 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2896 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2897 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2898 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2899 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2900 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2901 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2902 
2903 /* Module declarations from 'imate.functions.functions' */
2904 
2905 /* Module declarations from 'imate.functions.py_functions' */
2906 static PyTypeObject *__pyx_ptype_5imate_9functions_12py_functions_pyFunction = 0;
2907 
2908 /* Module declarations from 'imate.functions' */
2909 
2910 /* Module declarations from 'imate._definitions.types' */
2911 
2912 /* Module declarations from 'imate._c_linear_operator.c_linear_operator' */
2913 
2914 /* Module declarations from 'imate._c_linear_operator.py_c_linear_operator' */
2915 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2916 
2917 /* Module declarations from 'imate._c_linear_operator.py_c_matrix' */
2918 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2919 
2920 /* Module declarations from 'imate._c_linear_operator.py_c_affine_matrix_function' */
2921 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = 0;
2922 
2923 /* Module declarations from 'imate._c_linear_operator' */
2924 
2925 /* Module declarations from 'libc.math' */
2926 
2927 /* Module declarations from 'libc.string' */
2928 
2929 /* Module declarations from 'libc.stdlib' */
2930 
2931 /* Module declarations from 'imate._c_trace_estimator.c_trace_estimator' */
2932 
2933 /* Module declarations from 'scipy.linalg.cython_lapack' */
2934 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dbdsdc)(char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *); /*proto*/
2935 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dstev)(char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *); /*proto*/
2936 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_sbdsdc)(char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *); /*proto*/
2937 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_sstev)(char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *); /*proto*/
2938 
2939 /* Module declarations from 'imate._c_trace_estimator.py_c_trace_estimator' */
2940 static PyTypeObject *__pyx_array_type = 0;
2941 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2942 static PyTypeObject *__pyx_memoryview_type = 0;
2943 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2944 static PyObject *generic = 0;
2945 static PyObject *strided = 0;
2946 static PyObject *indirect = 0;
2947 static PyObject *contiguous = 0;
2948 static PyObject *indirect_contiguous = 0;
2949 static int __pyx_memoryview_thread_locks_used;
2950 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2951 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
2952 __PYX_EXTERN_C void lapack_sstev(char *, int *, float *, float *, float *, int *, float *, int *); /*proto*/
2953 __PYX_EXTERN_C void lapack_dstev(char *, int *, double *, double *, double *, int *, double *, int *); /*proto*/
2954 __PYX_EXTERN_C void lapack_sbdsdc(char *, char *, int *, float *, float *, float *, int *, float *, int *, float *, int *, float *, int *, int *); /*proto*/
2955 __PYX_EXTERN_C void lapack_dbdsdc(char *, char *, int *, double *, double *, double *, int *, double *, int *, double *, int *, double *, int *, int *); /*proto*/
2956 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_float(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, __pyx_t_5imate_12_definitions_5types_IndexType const , struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, float const , __pyx_t_5imate_12_definitions_5types_FlagType const , __pyx_t_5imate_12_definitions_5types_FlagType const , __pyx_t_5imate_12_definitions_5types_IndexType const , float const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , float const , float const , float const , float const , __pyx_t_5imate_12_definitions_5types_IndexType const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType, float &); /*proto*/
2957 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, __pyx_t_5imate_12_definitions_5types_IndexType const , struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, double const , __pyx_t_5imate_12_definitions_5types_FlagType const , __pyx_t_5imate_12_definitions_5types_FlagType const , __pyx_t_5imate_12_definitions_5types_IndexType const , double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , double const , double const , double const , double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType, float &); /*proto*/
2958 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_long_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, __pyx_t_5imate_12_definitions_5types_IndexType const , struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, long double const , __pyx_t_5imate_12_definitions_5types_FlagType const , __pyx_t_5imate_12_definitions_5types_FlagType const , __pyx_t_5imate_12_definitions_5types_IndexType const , long double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , long double const , long double const , long double const , long double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType, float &); /*proto*/
2959 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2960 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2961 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2962 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2963 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2964 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2965 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2966 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2967 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2968 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2969 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2970 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2971 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2972 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2973 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2974 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2975 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2976 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2977 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2978 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2979 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2980 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2981 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2982 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2983 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2984 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2985 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2986 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2987 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2988 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2989 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2990 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2991 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2992 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2993 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2994 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2995 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = { "long double", NULL, sizeof(long double), { 0 }, 0, 'R', 0, 0 };
2996 #define __Pyx_MODULE_NAME "imate._c_trace_estimator.py_c_trace_estimator"
2997 extern int __pyx_module_is_main_imate___c_trace_estimator__py_c_trace_estimator;
2998 int __pyx_module_is_main_imate___c_trace_estimator__py_c_trace_estimator = 0;
2999 
3000 /* Implementation of 'imate._c_trace_estimator.py_c_trace_estimator' */
3001 static PyObject *__pyx_builtin_TypeError;
3002 static PyObject *__pyx_builtin_range;
3003 static PyObject *__pyx_builtin_ValueError;
3004 static PyObject *__pyx_builtin_MemoryError;
3005 static PyObject *__pyx_builtin_enumerate;
3006 static PyObject *__pyx_builtin_Ellipsis;
3007 static PyObject *__pyx_builtin_id;
3008 static PyObject *__pyx_builtin_IndexError;
3009 static const char __pyx_k_O[] = "O";
3010 static const char __pyx_k_c[] = "c";
3011 static const char __pyx_k_id[] = "id";
3012 static const char __pyx_k_Aop[] = "Aop";
3013 static const char __pyx_k_new[] = "__new__";
3014 static const char __pyx_k_obj[] = "obj";
3015 static const char __pyx_k_base[] = "base";
3016 static const char __pyx_k_dict[] = "__dict__";
3017 static const char __pyx_k_main[] = "__main__";
3018 static const char __pyx_k_mode[] = "mode";
3019 static const char __pyx_k_name[] = "name";
3020 static const char __pyx_k_ndim[] = "ndim";
3021 static const char __pyx_k_pack[] = "pack";
3022 static const char __pyx_k_size[] = "size";
3023 static const char __pyx_k_step[] = "step";
3024 static const char __pyx_k_stop[] = "stop";
3025 static const char __pyx_k_test[] = "__test__";
3026 static const char __pyx_k_ASCII[] = "ASCII";
3027 static const char __pyx_k_class[] = "__class__";
3028 static const char __pyx_k_error[] = "error";
3029 static const char __pyx_k_flags[] = "flags";
3030 static const char __pyx_k_numpy[] = "numpy";
3031 static const char __pyx_k_range[] = "range";
3032 static const char __pyx_k_shape[] = "shape";
3033 static const char __pyx_k_start[] = "start";
3034 static const char __pyx_k_trace[] = "trace";
3035 static const char __pyx_k_encode[] = "encode";
3036 static const char __pyx_k_format[] = "format";
3037 static const char __pyx_k_import[] = "__import__";
3038 static const char __pyx_k_name_2[] = "__name__";
3039 static const char __pyx_k_pickle[] = "pickle";
3040 static const char __pyx_k_reduce[] = "__reduce__";
3041 static const char __pyx_k_struct[] = "struct";
3042 static const char __pyx_k_unpack[] = "unpack";
3043 static const char __pyx_k_update[] = "update";
3044 static const char __pyx_k_float32[] = "float32";
3045 static const char __pyx_k_float64[] = "float64";
3046 static const char __pyx_k_fortran[] = "fortran";
3047 static const char __pyx_k_memview[] = "memview";
3048 static const char __pyx_k_samples[] = "samples";
3049 static const char __pyx_k_Ellipsis[] = "Ellipsis";
3050 static const char __pyx_k_exponent[] = "exponent";
3051 static const char __pyx_k_float128[] = "float128";
3052 static const char __pyx_k_getstate[] = "__getstate__";
3053 static const char __pyx_k_isscalar[] = "isscalar";
3054 static const char __pyx_k_itemsize[] = "itemsize";
3055 static const char __pyx_k_pyx_type[] = "__pyx_type";
3056 static const char __pyx_k_setstate[] = "__setstate__";
3057 static const char __pyx_k_TypeError[] = "TypeError";
3058 static const char __pyx_k_converged[] = "converged";
3059 static const char __pyx_k_enumerate[] = "enumerate";
3060 static const char __pyx_k_pyx_state[] = "__pyx_state";
3061 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3062 static const char __pyx_k_symmetric[] = "symmetric";
3063 static const char __pyx_k_IndexError[] = "IndexError";
3064 static const char __pyx_k_ValueError[] = "ValueError";
3065 static const char __pyx_k_error_atol[] = "error_atol";
3066 static const char __pyx_k_error_rtol[] = "error_rtol";
3067 static const char __pyx_k_parameters[] = "parameters";
3068 static const char __pyx_k_pyx_result[] = "__pyx_result";
3069 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3070 static const char __pyx_k_MemoryError[] = "MemoryError";
3071 static const char __pyx_k_PickleError[] = "PickleError";
3072 static const char __pyx_k_lanczos_tol[] = "lanczos_tol";
3073 static const char __pyx_k_num_threads[] = "num_threads";
3074 static const char __pyx_k_num_outliers[] = "num_outliers";
3075 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3076 static const char __pyx_k_stringsource[] = "stringsource";
3077 static const char __pyx_k_num_inquiries[] = "num_inquiries";
3078 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
3079 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3080 static const char __pyx_k_alg_wall_times[] = "alg_wall_times";
3081 static const char __pyx_k_data_type_name[] = "data_type_name";
3082 static const char __pyx_k_lanczos_degree[] = "lanczos_degree";
3083 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3084 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3085 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3086 static const char __pyx_k_max_num_samples[] = "max_num_samples";
3087 static const char __pyx_k_min_num_samples[] = "min_num_samples";
3088 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3089 static const char __pyx_k_reorthogonalize[] = "reorthogonalize";
3090 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3091 static const char __pyx_k_confidence_level[] = "confidence_level";
3092 static const char __pyx_k_num_samples_used[] = "num_samples_used";
3093 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3094 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3095 static const char __pyx_k_py_matrix_function[] = "py_matrix_function";
3096 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3097 static const char __pyx_k_pyc_trace_estimator[] = "pyc_trace_estimator";
3098 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3099 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3100 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3101 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3102 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3103 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
3104 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
3105 static const char __pyx_k_processed_samples_indices[] = "processed_samples_indices";
3106 static const char __pyx_k_outlier_significance_level[] = "outlier_significance_level";
3107 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3108 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3109 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3110 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3111 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3112 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3113 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3114 static const char __pyx_k_Data_type_should_be_float32_floa[] = "Data type should be \"float32\", \"float64\", or \"float128\".";
3115 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3116 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
3117 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3118 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
3119 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
3120 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3121 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
3122 static const char __pyx_k_imate__c_trace_estimator_py_c_tr[] = "imate/_c_trace_estimator/py_c_trace_estimator.pyx";
3123 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3124 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3125 static const char __pyx_k_imate__c_trace_estimator_py_c_tr_2[] = "imate._c_trace_estimator.py_c_trace_estimator";
3126 static PyObject *__pyx_n_s_ASCII;
3127 static PyObject *__pyx_n_s_Aop;
3128 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3129 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3130 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3131 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3132 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
3133 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
3134 static PyObject *__pyx_n_s_Ellipsis;
3135 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3136 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
3137 static PyObject *__pyx_n_s_IndexError;
3138 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3139 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
3140 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
3141 static PyObject *__pyx_n_s_MemoryError;
3142 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3143 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
3144 static PyObject *__pyx_n_b_O;
3145 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
3146 static PyObject *__pyx_n_s_PickleError;
3147 static PyObject *__pyx_n_s_TypeError;
3148 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3149 static PyObject *__pyx_n_s_ValueError;
3150 static PyObject *__pyx_n_s_View_MemoryView;
3151 static PyObject *__pyx_n_s_alg_wall_times;
3152 static PyObject *__pyx_n_s_allocate_buffer;
3153 static PyObject *__pyx_n_s_base;
3154 static PyObject *__pyx_n_s_c;
3155 static PyObject *__pyx_n_u_c;
3156 static PyObject *__pyx_n_s_class;
3157 static PyObject *__pyx_n_s_cline_in_traceback;
3158 static PyObject *__pyx_n_s_confidence_level;
3159 static PyObject *__pyx_kp_s_contiguous_and_direct;
3160 static PyObject *__pyx_kp_s_contiguous_and_indirect;
3161 static PyObject *__pyx_n_s_converged;
3162 static PyObject *__pyx_n_s_data_type_name;
3163 static PyObject *__pyx_n_s_dict;
3164 static PyObject *__pyx_n_s_dtype_is_object;
3165 static PyObject *__pyx_n_s_encode;
3166 static PyObject *__pyx_n_s_enumerate;
3167 static PyObject *__pyx_n_s_error;
3168 static PyObject *__pyx_n_s_error_atol;
3169 static PyObject *__pyx_n_s_error_rtol;
3170 static PyObject *__pyx_n_s_exponent;
3171 static PyObject *__pyx_n_s_flags;
3172 static PyObject *__pyx_n_b_float128;
3173 static PyObject *__pyx_n_b_float32;
3174 static PyObject *__pyx_n_b_float64;
3175 static PyObject *__pyx_n_s_format;
3176 static PyObject *__pyx_n_s_fortran;
3177 static PyObject *__pyx_n_u_fortran;
3178 static PyObject *__pyx_n_s_getstate;
3179 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
3180 static PyObject *__pyx_n_s_id;
3181 static PyObject *__pyx_kp_s_imate__c_trace_estimator_py_c_tr;
3182 static PyObject *__pyx_n_s_imate__c_trace_estimator_py_c_tr_2;
3183 static PyObject *__pyx_n_s_import;
3184 static PyObject *__pyx_n_s_isscalar;
3185 static PyObject *__pyx_n_s_itemsize;
3186 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3187 static PyObject *__pyx_n_s_lanczos_degree;
3188 static PyObject *__pyx_n_s_lanczos_tol;
3189 static PyObject *__pyx_n_s_main;
3190 static PyObject *__pyx_n_s_max_num_samples;
3191 static PyObject *__pyx_n_s_memview;
3192 static PyObject *__pyx_n_s_min_num_samples;
3193 static PyObject *__pyx_n_s_mode;
3194 static PyObject *__pyx_n_s_name;
3195 static PyObject *__pyx_n_s_name_2;
3196 static PyObject *__pyx_n_s_ndim;
3197 static PyObject *__pyx_n_s_new;
3198 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3199 static PyObject *__pyx_n_s_num_inquiries;
3200 static PyObject *__pyx_n_s_num_outliers;
3201 static PyObject *__pyx_n_s_num_samples_used;
3202 static PyObject *__pyx_n_s_num_threads;
3203 static PyObject *__pyx_n_s_numpy;
3204 static PyObject *__pyx_n_s_obj;
3205 static PyObject *__pyx_n_s_outlier_significance_level;
3206 static PyObject *__pyx_n_s_pack;
3207 static PyObject *__pyx_n_s_parameters;
3208 static PyObject *__pyx_n_s_pickle;
3209 static PyObject *__pyx_n_s_processed_samples_indices;
3210 static PyObject *__pyx_n_s_py_matrix_function;
3211 static PyObject *__pyx_n_s_pyc_trace_estimator;
3212 static PyObject *__pyx_n_s_pyx_PickleError;
3213 static PyObject *__pyx_n_s_pyx_checksum;
3214 static PyObject *__pyx_n_s_pyx_getbuffer;
3215 static PyObject *__pyx_n_s_pyx_result;
3216 static PyObject *__pyx_n_s_pyx_state;
3217 static PyObject *__pyx_n_s_pyx_type;
3218 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
3219 static PyObject *__pyx_n_s_pyx_vtable;
3220 static PyObject *__pyx_n_s_range;
3221 static PyObject *__pyx_n_s_reduce;
3222 static PyObject *__pyx_n_s_reduce_cython;
3223 static PyObject *__pyx_n_s_reduce_ex;
3224 static PyObject *__pyx_n_s_reorthogonalize;
3225 static PyObject *__pyx_n_s_samples;
3226 static PyObject *__pyx_n_s_setstate;
3227 static PyObject *__pyx_n_s_setstate_cython;
3228 static PyObject *__pyx_n_s_shape;
3229 static PyObject *__pyx_n_s_size;
3230 static PyObject *__pyx_n_s_start;
3231 static PyObject *__pyx_n_s_step;
3232 static PyObject *__pyx_n_s_stop;
3233 static PyObject *__pyx_kp_s_strided_and_direct;
3234 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3235 static PyObject *__pyx_kp_s_strided_and_indirect;
3236 static PyObject *__pyx_kp_s_stringsource;
3237 static PyObject *__pyx_n_s_struct;
3238 static PyObject *__pyx_n_s_symmetric;
3239 static PyObject *__pyx_n_s_test;
3240 static PyObject *__pyx_n_s_trace;
3241 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3242 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3243 static PyObject *__pyx_n_s_unpack;
3244 static PyObject *__pyx_n_s_update;
3245 static PyObject *__pyx_pf_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, PyObject *__pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, PyObject *__pyx_v_exponent, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_reorthogonalize, PyObject *__pyx_v_lanczos_degree, PyObject *__pyx_v_lanczos_tol, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_data_type_name, PyObject *__pyx_v_trace, PyObject *__pyx_v_error, PyObject *__pyx_v_samples, PyObject *__pyx_v_processed_samples_indices, PyObject *__pyx_v_num_samples_used, PyObject *__pyx_v_num_outliers, PyObject *__pyx_v_converged, PyObject *__pyx_v_alg_wall_times); /* proto */
3246 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3247 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3248 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3249 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3250 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3251 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3252 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3253 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3254 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3255 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3256 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3257 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3258 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3259 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3260 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3261 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3262 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3263 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3264 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3265 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3266 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3267 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3268 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3269 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3270 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3271 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3272 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3273 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3274 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3275 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3276 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3277 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3278 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3279 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3280 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3281 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3282 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3283 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3284 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3285 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3286 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3287 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3288 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3289 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3290 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3291 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3292 static PyObject *__pyx_int_0;
3293 static PyObject *__pyx_int_1;
3294 static PyObject *__pyx_int_112105877;
3295 static PyObject *__pyx_int_136983863;
3296 static PyObject *__pyx_int_184977713;
3297 static PyObject *__pyx_int_neg_1;
3298 static PyObject *__pyx_codeobj_;
3299 static PyObject *__pyx_tuple__2;
3300 static PyObject *__pyx_tuple__3;
3301 static PyObject *__pyx_tuple__4;
3302 static PyObject *__pyx_tuple__5;
3303 static PyObject *__pyx_tuple__6;
3304 static PyObject *__pyx_tuple__7;
3305 static PyObject *__pyx_tuple__8;
3306 static PyObject *__pyx_tuple__9;
3307 static PyObject *__pyx_slice__17;
3308 static PyObject *__pyx_tuple__10;
3309 static PyObject *__pyx_tuple__11;
3310 static PyObject *__pyx_tuple__12;
3311 static PyObject *__pyx_tuple__13;
3312 static PyObject *__pyx_tuple__14;
3313 static PyObject *__pyx_tuple__15;
3314 static PyObject *__pyx_tuple__16;
3315 static PyObject *__pyx_tuple__18;
3316 static PyObject *__pyx_tuple__19;
3317 static PyObject *__pyx_tuple__20;
3318 static PyObject *__pyx_tuple__22;
3319 static PyObject *__pyx_tuple__23;
3320 static PyObject *__pyx_tuple__24;
3321 static PyObject *__pyx_tuple__25;
3322 static PyObject *__pyx_tuple__26;
3323 static PyObject *__pyx_tuple__27;
3324 static PyObject *__pyx_tuple__28;
3325 static PyObject *__pyx_tuple__29;
3326 static PyObject *__pyx_codeobj__21;
3327 /* Late includes */
3328 
3329 /* "imate/_c_trace_estimator/lapack_api.pxi":21
3330  * # ============
3331  *
3332  * cdef public void lapack_sstev(char* jobz, int* n, float* d, float* e, float* z, # <<<<<<<<<<<<<<
3333  * int* ldz, float* work, int* info) nogil:
3334  * """
3335  */
3336 
3337 void lapack_sstev(char *__pyx_v_jobz, int *__pyx_v_n, float *__pyx_v_d, float *__pyx_v_e, float *__pyx_v_z, int *__pyx_v_ldz, float *__pyx_v_work, int *__pyx_v_info) {
3338  __Pyx_TraceDeclarations
3339  int __pyx_lineno = 0;
3340  const char *__pyx_filename = NULL;
3341  int __pyx_clineno = 0;
3342  __Pyx_TraceCall("lapack_sstev", __pyx_f[1], 21, 1, __PYX_ERR(1, 21, __pyx_L1_error));
3343 
3344  /* "imate/_c_trace_estimator/lapack_api.pxi":34
3345  * """
3346  *
3347  * sstev(jobz, n, d, e, z, ldz, work, info) # <<<<<<<<<<<<<<
3348  *
3349  *
3350  */
3351  __Pyx_TraceLine(34,1,__PYX_ERR(1, 34, __pyx_L1_error))
3352  __pyx_f_5scipy_6linalg_13cython_lapack_sstev(__pyx_v_jobz, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_z, __pyx_v_ldz, __pyx_v_work, __pyx_v_info);
3353 
3354  /* "imate/_c_trace_estimator/lapack_api.pxi":21
3355  * # ============
3356  *
3357  * cdef public void lapack_sstev(char* jobz, int* n, float* d, float* e, float* z, # <<<<<<<<<<<<<<
3358  * int* ldz, float* work, int* info) nogil:
3359  * """
3360  */
3361 
3362  /* function exit code */
3363  goto __pyx_L0;
3364  __pyx_L1_error:;
3365  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_sstev", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3366  __pyx_L0:;
3367  __Pyx_TraceReturn(Py_None, 1);
3368 }
3369 
3370 /* "imate/_c_trace_estimator/lapack_api.pxi":41
3371  * # ============
3372  *
3373  * cdef public void lapack_dstev(char* jobz, int* n, double* d, double* e, # <<<<<<<<<<<<<<
3374  * double* z, int* ldz, double* work,
3375  * int* info) nogil:
3376  */
3377 
3378 void lapack_dstev(char *__pyx_v_jobz, int *__pyx_v_n, double *__pyx_v_d, double *__pyx_v_e, double *__pyx_v_z, int *__pyx_v_ldz, double *__pyx_v_work, int *__pyx_v_info) {
3379  __Pyx_TraceDeclarations
3380  int __pyx_lineno = 0;
3381  const char *__pyx_filename = NULL;
3382  int __pyx_clineno = 0;
3383  __Pyx_TraceCall("lapack_dstev", __pyx_f[1], 41, 1, __PYX_ERR(1, 41, __pyx_L1_error));
3384 
3385  /* "imate/_c_trace_estimator/lapack_api.pxi":55
3386  * """
3387  *
3388  * dstev(jobz, n, d, e, z, ldz, work, info) # <<<<<<<<<<<<<<
3389  *
3390  *
3391  */
3392  __Pyx_TraceLine(55,1,__PYX_ERR(1, 55, __pyx_L1_error))
3393  __pyx_f_5scipy_6linalg_13cython_lapack_dstev(__pyx_v_jobz, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_z, __pyx_v_ldz, __pyx_v_work, __pyx_v_info);
3394 
3395  /* "imate/_c_trace_estimator/lapack_api.pxi":41
3396  * # ============
3397  *
3398  * cdef public void lapack_dstev(char* jobz, int* n, double* d, double* e, # <<<<<<<<<<<<<<
3399  * double* z, int* ldz, double* work,
3400  * int* info) nogil:
3401  */
3402 
3403  /* function exit code */
3404  goto __pyx_L0;
3405  __pyx_L1_error:;
3406  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_dstev", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3407  __pyx_L0:;
3408  __Pyx_TraceReturn(Py_None, 1);
3409 }
3410 
3411 /* "imate/_c_trace_estimator/lapack_api.pxi":62
3412  * # =============
3413  *
3414  * cdef public void lapack_sbdsdc(char* uplo, char* compq, int* n, float* d, # <<<<<<<<<<<<<<
3415  * float *e, float* u, int* ldu, float* vt,
3416  * int* ldvt, float* q, int* iq, float* work,
3417  */
3418 
3419 void lapack_sbdsdc(char *__pyx_v_uplo, char *__pyx_v_compq, int *__pyx_v_n, float *__pyx_v_d, float *__pyx_v_e, float *__pyx_v_u, int *__pyx_v_ldu, float *__pyx_v_vt, int *__pyx_v_ldvt, float *__pyx_v_q, int *__pyx_v_iq, float *__pyx_v_work, int *__pyx_v_iwork, int *__pyx_v_info) {
3420  __Pyx_TraceDeclarations
3421  int __pyx_lineno = 0;
3422  const char *__pyx_filename = NULL;
3423  int __pyx_clineno = 0;
3424  __Pyx_TraceCall("lapack_sbdsdc", __pyx_f[1], 62, 1, __PYX_ERR(1, 62, __pyx_L1_error));
3425 
3426  /* "imate/_c_trace_estimator/lapack_api.pxi":77
3427  * """
3428  *
3429  * sbdsdc(uplo, compq, n, d, e, u, ldu, vt, ldvt, q, iq, work, iwork, info) # <<<<<<<<<<<<<<
3430  *
3431  *
3432  */
3433  __Pyx_TraceLine(77,1,__PYX_ERR(1, 77, __pyx_L1_error))
3434  __pyx_f_5scipy_6linalg_13cython_lapack_sbdsdc(__pyx_v_uplo, __pyx_v_compq, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_u, __pyx_v_ldu, __pyx_v_vt, __pyx_v_ldvt, __pyx_v_q, __pyx_v_iq, __pyx_v_work, __pyx_v_iwork, __pyx_v_info);
3435 
3436  /* "imate/_c_trace_estimator/lapack_api.pxi":62
3437  * # =============
3438  *
3439  * cdef public void lapack_sbdsdc(char* uplo, char* compq, int* n, float* d, # <<<<<<<<<<<<<<
3440  * float *e, float* u, int* ldu, float* vt,
3441  * int* ldvt, float* q, int* iq, float* work,
3442  */
3443 
3444  /* function exit code */
3445  goto __pyx_L0;
3446  __pyx_L1_error:;
3447  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_sbdsdc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3448  __pyx_L0:;
3449  __Pyx_TraceReturn(Py_None, 1);
3450 }
3451 
3452 /* "imate/_c_trace_estimator/lapack_api.pxi":84
3453  * # =============
3454  *
3455  * cdef public void lapack_dbdsdc(char* uplo, char* compq, int* n, double* d, # <<<<<<<<<<<<<<
3456  * double *e, double* u, int* ldu, double* vt,
3457  * int* ldvt, double* q, int* iq, double* work,
3458  */
3459 
3460 void lapack_dbdsdc(char *__pyx_v_uplo, char *__pyx_v_compq, int *__pyx_v_n, double *__pyx_v_d, double *__pyx_v_e, double *__pyx_v_u, int *__pyx_v_ldu, double *__pyx_v_vt, int *__pyx_v_ldvt, double *__pyx_v_q, int *__pyx_v_iq, double *__pyx_v_work, int *__pyx_v_iwork, int *__pyx_v_info) {
3461  __Pyx_TraceDeclarations
3462  int __pyx_lineno = 0;
3463  const char *__pyx_filename = NULL;
3464  int __pyx_clineno = 0;
3465  __Pyx_TraceCall("lapack_dbdsdc", __pyx_f[1], 84, 1, __PYX_ERR(1, 84, __pyx_L1_error));
3466 
3467  /* "imate/_c_trace_estimator/lapack_api.pxi":99
3468  * """
3469  *
3470  * dbdsdc(uplo, compq, n, d, e, u, ldu, vt, ldvt, q, iq, work, iwork, info) # <<<<<<<<<<<<<<
3471  */
3472  __Pyx_TraceLine(99,1,__PYX_ERR(1, 99, __pyx_L1_error))
3473  __pyx_f_5scipy_6linalg_13cython_lapack_dbdsdc(__pyx_v_uplo, __pyx_v_compq, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_u, __pyx_v_ldu, __pyx_v_vt, __pyx_v_ldvt, __pyx_v_q, __pyx_v_iq, __pyx_v_work, __pyx_v_iwork, __pyx_v_info);
3474 
3475  /* "imate/_c_trace_estimator/lapack_api.pxi":84
3476  * # =============
3477  *
3478  * cdef public void lapack_dbdsdc(char* uplo, char* compq, int* n, double* d, # <<<<<<<<<<<<<<
3479  * double *e, double* u, int* ldu, double* vt,
3480  * int* ldvt, double* q, int* iq, double* work,
3481  */
3482 
3483  /* function exit code */
3484  goto __pyx_L0;
3485  __pyx_L1_error:;
3486  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_dbdsdc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3487  __pyx_L0:;
3488  __Pyx_TraceReturn(Py_None, 1);
3489 }
3490 
3491 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":38
3492  * # ===================
3493  *
3494  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
3495  * pycLinearOperator Aop,
3496  * parameters,
3497  */
3498 
3499 static PyObject *__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3500 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, PyObject *__pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, PyObject *__pyx_v_exponent, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_reorthogonalize, PyObject *__pyx_v_lanczos_degree, PyObject *__pyx_v_lanczos_tol, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_data_type_name, PyObject *__pyx_v_trace, PyObject *__pyx_v_error, PyObject *__pyx_v_samples, PyObject *__pyx_v_processed_samples_indices, PyObject *__pyx_v_num_samples_used, PyObject *__pyx_v_num_outliers, PyObject *__pyx_v_converged, PyObject *__pyx_v_alg_wall_times, CYTHON_UNUSED int __pyx_skip_dispatch) {
3501  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
3502  float __pyx_v_alg_wall_time;
3503  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
3504  __Pyx_TraceDeclarations
3505  __Pyx_RefNannyDeclarations
3506  int __pyx_t_1;
3507  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_2;
3508  float __pyx_t_3;
3509  PyObject *__pyx_t_4 = NULL;
3510  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_5;
3511  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_6;
3512  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_7;
3513  float __pyx_t_8;
3514  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_9;
3515  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
3516  float __pyx_t_11;
3517  float __pyx_t_12;
3518  float __pyx_t_13;
3519  float __pyx_t_14;
3520  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_15;
3521  __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
3522  __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
3523  __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
3524  __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
3525  __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
3526  __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
3527  __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } };
3528  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_23;
3529  double __pyx_t_24;
3530  double __pyx_t_25;
3531  double __pyx_t_26;
3532  double __pyx_t_27;
3533  double __pyx_t_28;
3534  double __pyx_t_29;
3535  __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
3536  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
3537  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
3538  long double __pyx_t_33;
3539  long double __pyx_t_34;
3540  long double __pyx_t_35;
3541  long double __pyx_t_36;
3542  long double __pyx_t_37;
3543  long double __pyx_t_38;
3544  __Pyx_memviewslice __pyx_t_39 = { 0, 0, { 0 }, { 0 }, { 0 } };
3545  __Pyx_memviewslice __pyx_t_40 = { 0, 0, { 0 }, { 0 }, { 0 } };
3546  __Pyx_memviewslice __pyx_t_41 = { 0, 0, { 0 }, { 0 }, { 0 } };
3547  int __pyx_lineno = 0;
3548  const char *__pyx_filename = NULL;
3549  int __pyx_clineno = 0;
3550  __Pyx_TraceFrameInit(__pyx_codeobj_)
3551  __Pyx_RefNannySetupContext("pyc_trace_estimator", 0);
3552  __Pyx_TraceCall("pyc_trace_estimator", __pyx_f[0], 38, 0, __PYX_ERR(0, 38, __pyx_L1_error));
3553 
3554  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":67
3555  * """
3556  *
3557  * cdef FlagType all_converged = 0 # <<<<<<<<<<<<<<
3558  * cdef float alg_wall_time = 0.0
3559  *
3560  */
3561  __Pyx_TraceLine(67,0,__PYX_ERR(0, 67, __pyx_L1_error))
3562  __pyx_v_all_converged = 0;
3563 
3564  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":68
3565  *
3566  * cdef FlagType all_converged = 0
3567  * cdef float alg_wall_time = 0.0 # <<<<<<<<<<<<<<
3568  *
3569  * if data_type_name == b'float32':
3570  */
3571  __Pyx_TraceLine(68,0,__PYX_ERR(0, 68, __pyx_L1_error))
3572  __pyx_v_alg_wall_time = 0.0;
3573 
3574  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":70
3575  * cdef float alg_wall_time = 0.0
3576  *
3577  * if data_type_name == b'float32': # <<<<<<<<<<<<<<
3578  *
3579  * all_converged = _pyc_trace_estimator_float(
3580  */
3581  __Pyx_TraceLine(70,0,__PYX_ERR(0, 70, __pyx_L1_error))
3582  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 70, __pyx_L1_error)
3583  if (__pyx_t_1) {
3584 
3585  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":75
3586  * Aop,
3587  * parameters,
3588  * num_inquiries, # <<<<<<<<<<<<<<
3589  * py_matrix_function,
3590  * exponent,
3591  */
3592  __Pyx_TraceLine(75,0,__PYX_ERR(0, 75, __pyx_L1_error))
3593  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_num_inquiries); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
3594 
3595  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":77
3596  * num_inquiries,
3597  * py_matrix_function,
3598  * exponent, # <<<<<<<<<<<<<<
3599  * int(symmetric),
3600  * reorthogonalize,
3601  */
3602  __Pyx_TraceLine(77,0,__PYX_ERR(0, 77, __pyx_L1_error))
3603  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_exponent); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error)
3604 
3605  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":78
3606  * py_matrix_function,
3607  * exponent,
3608  * int(symmetric), # <<<<<<<<<<<<<<
3609  * reorthogonalize,
3610  * lanczos_degree,
3611  */
3612  __Pyx_TraceLine(78,0,__PYX_ERR(0, 78, __pyx_L1_error))
3613  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_symmetric); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
3614  __Pyx_GOTREF(__pyx_t_4);
3615  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
3616  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3617 
3618  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":79
3619  * exponent,
3620  * int(symmetric),
3621  * reorthogonalize, # <<<<<<<<<<<<<<
3622  * lanczos_degree,
3623  * lanczos_tol,
3624  */
3625  __Pyx_TraceLine(79,0,__PYX_ERR(0, 79, __pyx_L1_error))
3626  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_reorthogonalize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
3627 
3628  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":80
3629  * int(symmetric),
3630  * reorthogonalize,
3631  * lanczos_degree, # <<<<<<<<<<<<<<
3632  * lanczos_tol,
3633  * min_num_samples,
3634  */
3635  __Pyx_TraceLine(80,0,__PYX_ERR(0, 80, __pyx_L1_error))
3636  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_lanczos_degree); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
3637 
3638  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":81
3639  * reorthogonalize,
3640  * lanczos_degree,
3641  * lanczos_tol, # <<<<<<<<<<<<<<
3642  * min_num_samples,
3643  * max_num_samples,
3644  */
3645  __Pyx_TraceLine(81,0,__PYX_ERR(0, 81, __pyx_L1_error))
3646  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_lanczos_tol); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
3647 
3648  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":82
3649  * lanczos_degree,
3650  * lanczos_tol,
3651  * min_num_samples, # <<<<<<<<<<<<<<
3652  * max_num_samples,
3653  * error_atol,
3654  */
3655  __Pyx_TraceLine(82,0,__PYX_ERR(0, 82, __pyx_L1_error))
3656  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_min_num_samples); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
3657 
3658  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":83
3659  * lanczos_tol,
3660  * min_num_samples,
3661  * max_num_samples, # <<<<<<<<<<<<<<
3662  * error_atol,
3663  * error_rtol,
3664  */
3665  __Pyx_TraceLine(83,0,__PYX_ERR(0, 83, __pyx_L1_error))
3666  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
3667 
3668  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":84
3669  * min_num_samples,
3670  * max_num_samples,
3671  * error_atol, # <<<<<<<<<<<<<<
3672  * error_rtol,
3673  * confidence_level,
3674  */
3675  __Pyx_TraceLine(84,0,__PYX_ERR(0, 84, __pyx_L1_error))
3676  __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_v_error_atol); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error)
3677 
3678  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":85
3679  * max_num_samples,
3680  * error_atol,
3681  * error_rtol, # <<<<<<<<<<<<<<
3682  * confidence_level,
3683  * outlier_significance_level,
3684  */
3685  __Pyx_TraceLine(85,0,__PYX_ERR(0, 85, __pyx_L1_error))
3686  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_error_rtol); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
3687 
3688  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":86
3689  * error_atol,
3690  * error_rtol,
3691  * confidence_level, # <<<<<<<<<<<<<<
3692  * outlier_significance_level,
3693  * num_threads,
3694  */
3695  __Pyx_TraceLine(86,0,__PYX_ERR(0, 86, __pyx_L1_error))
3696  __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_confidence_level); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error)
3697 
3698  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":87
3699  * error_rtol,
3700  * confidence_level,
3701  * outlier_significance_level, # <<<<<<<<<<<<<<
3702  * num_threads,
3703  * trace,
3704  */
3705  __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error))
3706  __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_outlier_significance_level); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error)
3707 
3708  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":88
3709  * confidence_level,
3710  * outlier_significance_level,
3711  * num_threads, # <<<<<<<<<<<<<<
3712  * trace,
3713  * error,
3714  */
3715  __Pyx_TraceLine(88,0,__PYX_ERR(0, 88, __pyx_L1_error))
3716  __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3717 
3718  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":89
3719  * outlier_significance_level,
3720  * num_threads,
3721  * trace, # <<<<<<<<<<<<<<
3722  * error,
3723  * samples,
3724  */
3725  __Pyx_TraceLine(89,0,__PYX_ERR(0, 89, __pyx_L1_error))
3726  __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_trace, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 89, __pyx_L1_error)
3727 
3728  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":90
3729  * num_threads,
3730  * trace,
3731  * error, # <<<<<<<<<<<<<<
3732  * samples,
3733  * processed_samples_indices,
3734  */
3735  __Pyx_TraceLine(90,0,__PYX_ERR(0, 90, __pyx_L1_error))
3736  __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_error, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 90, __pyx_L1_error)
3737 
3738  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":91
3739  * trace,
3740  * error,
3741  * samples, # <<<<<<<<<<<<<<
3742  * processed_samples_indices,
3743  * num_samples_used,
3744  */
3745  __Pyx_TraceLine(91,0,__PYX_ERR(0, 91, __pyx_L1_error))
3746  __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_samples, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 91, __pyx_L1_error)
3747 
3748  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":92
3749  * error,
3750  * samples,
3751  * processed_samples_indices, # <<<<<<<<<<<<<<
3752  * num_samples_used,
3753  * num_outliers,
3754  */
3755  __Pyx_TraceLine(92,0,__PYX_ERR(0, 92, __pyx_L1_error))
3756  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_processed_samples_indices, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 92, __pyx_L1_error)
3757 
3758  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":93
3759  * samples,
3760  * processed_samples_indices,
3761  * num_samples_used, # <<<<<<<<<<<<<<
3762  * num_outliers,
3763  * converged,
3764  */
3765  __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error))
3766  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_samples_used, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 93, __pyx_L1_error)
3767 
3768  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":94
3769  * processed_samples_indices,
3770  * num_samples_used,
3771  * num_outliers, # <<<<<<<<<<<<<<
3772  * converged,
3773  * alg_wall_time)
3774  */
3775  __Pyx_TraceLine(94,0,__PYX_ERR(0, 94, __pyx_L1_error))
3776  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_outliers, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3777 
3778  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":95
3779  * num_samples_used,
3780  * num_outliers,
3781  * converged, # <<<<<<<<<<<<<<
3782  * alg_wall_time)
3783  *
3784  */
3785  __Pyx_TraceLine(95,0,__PYX_ERR(0, 95, __pyx_L1_error))
3786  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_converged, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 95, __pyx_L1_error)
3787 
3788  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":72
3789  * if data_type_name == b'float32':
3790  *
3791  * all_converged = _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
3792  * Aop,
3793  * parameters,
3794  */
3795  __Pyx_TraceLine(72,0,__PYX_ERR(0, 72, __pyx_L1_error))
3796  __pyx_t_23 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_float(__pyx_v_Aop, __pyx_v_parameters, __pyx_t_2, __pyx_v_py_matrix_function, __pyx_t_3, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_v_alg_wall_time); if (unlikely(__pyx_t_23 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error)
3797  __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
3798  __pyx_t_16.memview = NULL;
3799  __pyx_t_16.data = NULL;
3800  __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
3801  __pyx_t_17.memview = NULL;
3802  __pyx_t_17.data = NULL;
3803  __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
3804  __pyx_t_18.memview = NULL;
3805  __pyx_t_18.data = NULL;
3806  __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
3807  __pyx_t_19.memview = NULL;
3808  __pyx_t_19.data = NULL;
3809  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
3810  __pyx_t_20.memview = NULL;
3811  __pyx_t_20.data = NULL;
3812  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
3813  __pyx_t_21.memview = NULL;
3814  __pyx_t_21.data = NULL;
3815  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
3816  __pyx_t_22.memview = NULL;
3817  __pyx_t_22.data = NULL;
3818  __pyx_v_all_converged = __pyx_t_23;
3819 
3820  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":70
3821  * cdef float alg_wall_time = 0.0
3822  *
3823  * if data_type_name == b'float32': # <<<<<<<<<<<<<<
3824  *
3825  * all_converged = _pyc_trace_estimator_float(
3826  */
3827  goto __pyx_L3;
3828  }
3829 
3830  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":98
3831  * alg_wall_time)
3832  *
3833  * elif data_type_name == b'float64': # <<<<<<<<<<<<<<
3834  *
3835  * all_converged = _pyc_trace_estimator_double(
3836  */
3837  __Pyx_TraceLine(98,0,__PYX_ERR(0, 98, __pyx_L1_error))
3838  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
3839  if (__pyx_t_1) {
3840 
3841  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":103
3842  * Aop,
3843  * parameters,
3844  * num_inquiries, # <<<<<<<<<<<<<<
3845  * py_matrix_function,
3846  * exponent,
3847  */
3848  __Pyx_TraceLine(103,0,__PYX_ERR(0, 103, __pyx_L1_error))
3849  __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_num_inquiries); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error)
3850 
3851  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":105
3852  * num_inquiries,
3853  * py_matrix_function,
3854  * exponent, # <<<<<<<<<<<<<<
3855  * int(symmetric),
3856  * reorthogonalize,
3857  */
3858  __Pyx_TraceLine(105,0,__PYX_ERR(0, 105, __pyx_L1_error))
3859  __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_exponent); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
3860 
3861  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":106
3862  * py_matrix_function,
3863  * exponent,
3864  * int(symmetric), # <<<<<<<<<<<<<<
3865  * reorthogonalize,
3866  * lanczos_degree,
3867  */
3868  __Pyx_TraceLine(106,0,__PYX_ERR(0, 106, __pyx_L1_error))
3869  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_symmetric); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
3870  __Pyx_GOTREF(__pyx_t_4);
3871  __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
3872  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3873 
3874  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":107
3875  * exponent,
3876  * int(symmetric),
3877  * reorthogonalize, # <<<<<<<<<<<<<<
3878  * lanczos_degree,
3879  * lanczos_tol,
3880  */
3881  __Pyx_TraceLine(107,0,__PYX_ERR(0, 107, __pyx_L1_error))
3882  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_reorthogonalize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
3883 
3884  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":108
3885  * int(symmetric),
3886  * reorthogonalize,
3887  * lanczos_degree, # <<<<<<<<<<<<<<
3888  * lanczos_tol,
3889  * min_num_samples,
3890  */
3891  __Pyx_TraceLine(108,0,__PYX_ERR(0, 108, __pyx_L1_error))
3892  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_lanczos_degree); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
3893 
3894  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":109
3895  * reorthogonalize,
3896  * lanczos_degree,
3897  * lanczos_tol, # <<<<<<<<<<<<<<
3898  * min_num_samples,
3899  * max_num_samples,
3900  */
3901  __Pyx_TraceLine(109,0,__PYX_ERR(0, 109, __pyx_L1_error))
3902  __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_lanczos_tol); if (unlikely((__pyx_t_25 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error)
3903 
3904  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":110
3905  * lanczos_degree,
3906  * lanczos_tol,
3907  * min_num_samples, # <<<<<<<<<<<<<<
3908  * max_num_samples,
3909  * error_atol,
3910  */
3911  __Pyx_TraceLine(110,0,__PYX_ERR(0, 110, __pyx_L1_error))
3912  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_min_num_samples); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L1_error)
3913 
3914  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":111
3915  * lanczos_tol,
3916  * min_num_samples,
3917  * max_num_samples, # <<<<<<<<<<<<<<
3918  * error_atol,
3919  * error_rtol,
3920  */
3921  __Pyx_TraceLine(111,0,__PYX_ERR(0, 111, __pyx_L1_error))
3922  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error)
3923 
3924  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":112
3925  * min_num_samples,
3926  * max_num_samples,
3927  * error_atol, # <<<<<<<<<<<<<<
3928  * error_rtol,
3929  * confidence_level,
3930  */
3931  __Pyx_TraceLine(112,0,__PYX_ERR(0, 112, __pyx_L1_error))
3932  __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_error_atol); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
3933 
3934  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":113
3935  * max_num_samples,
3936  * error_atol,
3937  * error_rtol, # <<<<<<<<<<<<<<
3938  * confidence_level,
3939  * outlier_significance_level,
3940  */
3941  __Pyx_TraceLine(113,0,__PYX_ERR(0, 113, __pyx_L1_error))
3942  __pyx_t_27 = __pyx_PyFloat_AsDouble(__pyx_v_error_rtol); if (unlikely((__pyx_t_27 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
3943 
3944  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":114
3945  * error_atol,
3946  * error_rtol,
3947  * confidence_level, # <<<<<<<<<<<<<<
3948  * outlier_significance_level,
3949  * num_threads,
3950  */
3951  __Pyx_TraceLine(114,0,__PYX_ERR(0, 114, __pyx_L1_error))
3952  __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_v_confidence_level); if (unlikely((__pyx_t_28 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
3953 
3954  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":115
3955  * error_rtol,
3956  * confidence_level,
3957  * outlier_significance_level, # <<<<<<<<<<<<<<
3958  * num_threads,
3959  * trace,
3960  */
3961  __Pyx_TraceLine(115,0,__PYX_ERR(0, 115, __pyx_L1_error))
3962  __pyx_t_29 = __pyx_PyFloat_AsDouble(__pyx_v_outlier_significance_level); if (unlikely((__pyx_t_29 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
3963 
3964  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":116
3965  * confidence_level,
3966  * outlier_significance_level,
3967  * num_threads, # <<<<<<<<<<<<<<
3968  * trace,
3969  * error,
3970  */
3971  __Pyx_TraceLine(116,0,__PYX_ERR(0, 116, __pyx_L1_error))
3972  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
3973 
3974  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":117
3975  * outlier_significance_level,
3976  * num_threads,
3977  * trace, # <<<<<<<<<<<<<<
3978  * error,
3979  * samples,
3980  */
3981  __Pyx_TraceLine(117,0,__PYX_ERR(0, 117, __pyx_L1_error))
3982  __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_trace, PyBUF_WRITABLE); if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 117, __pyx_L1_error)
3983 
3984  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":118
3985  * num_threads,
3986  * trace,
3987  * error, # <<<<<<<<<<<<<<
3988  * samples,
3989  * processed_samples_indices,
3990  */
3991  __Pyx_TraceLine(118,0,__PYX_ERR(0, 118, __pyx_L1_error))
3992  __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_error, PyBUF_WRITABLE); if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 118, __pyx_L1_error)
3993 
3994  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":119
3995  * trace,
3996  * error,
3997  * samples, # <<<<<<<<<<<<<<
3998  * processed_samples_indices,
3999  * num_samples_used,
4000  */
4001  __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error))
4002  __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_samples, PyBUF_WRITABLE); if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 119, __pyx_L1_error)
4003 
4004  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":120
4005  * error,
4006  * samples,
4007  * processed_samples_indices, # <<<<<<<<<<<<<<
4008  * num_samples_used,
4009  * num_outliers,
4010  */
4011  __Pyx_TraceLine(120,0,__PYX_ERR(0, 120, __pyx_L1_error))
4012  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_processed_samples_indices, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4013 
4014  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":121
4015  * samples,
4016  * processed_samples_indices,
4017  * num_samples_used, # <<<<<<<<<<<<<<
4018  * num_outliers,
4019  * converged,
4020  */
4021  __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error))
4022  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_samples_used, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
4023 
4024  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":122
4025  * processed_samples_indices,
4026  * num_samples_used,
4027  * num_outliers, # <<<<<<<<<<<<<<
4028  * converged,
4029  * alg_wall_time)
4030  */
4031  __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error))
4032  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_outliers, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 122, __pyx_L1_error)
4033 
4034  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":123
4035  * num_samples_used,
4036  * num_outliers,
4037  * converged, # <<<<<<<<<<<<<<
4038  * alg_wall_time)
4039  *
4040  */
4041  __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error))
4042  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_converged, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 123, __pyx_L1_error)
4043 
4044  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":100
4045  * elif data_type_name == b'float64':
4046  *
4047  * all_converged = _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
4048  * Aop,
4049  * parameters,
4050  */
4051  __Pyx_TraceLine(100,0,__PYX_ERR(0, 100, __pyx_L1_error))
4052  __pyx_t_5 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_double(__pyx_v_Aop, __pyx_v_parameters, __pyx_t_15, __pyx_v_py_matrix_function, __pyx_t_24, __pyx_t_23, __pyx_t_6, __pyx_t_10, __pyx_t_25, __pyx_t_9, __pyx_t_7, __pyx_t_26, __pyx_t_27, __pyx_t_28, __pyx_t_29, __pyx_t_2, __pyx_t_30, __pyx_t_31, __pyx_t_32, __pyx_t_21, __pyx_t_20, __pyx_t_19, __pyx_t_22, __pyx_v_alg_wall_time); if (unlikely(__pyx_t_5 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
4053  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
4054  __pyx_t_30.memview = NULL;
4055  __pyx_t_30.data = NULL;
4056  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
4057  __pyx_t_31.memview = NULL;
4058  __pyx_t_31.data = NULL;
4059  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
4060  __pyx_t_32.memview = NULL;
4061  __pyx_t_32.data = NULL;
4062  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4063  __pyx_t_21.memview = NULL;
4064  __pyx_t_21.data = NULL;
4065  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4066  __pyx_t_20.memview = NULL;
4067  __pyx_t_20.data = NULL;
4068  __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
4069  __pyx_t_19.memview = NULL;
4070  __pyx_t_19.data = NULL;
4071  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4072  __pyx_t_22.memview = NULL;
4073  __pyx_t_22.data = NULL;
4074  __pyx_v_all_converged = __pyx_t_5;
4075 
4076  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":98
4077  * alg_wall_time)
4078  *
4079  * elif data_type_name == b'float64': # <<<<<<<<<<<<<<
4080  *
4081  * all_converged = _pyc_trace_estimator_double(
4082  */
4083  goto __pyx_L3;
4084  }
4085 
4086  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":126
4087  * alg_wall_time)
4088  *
4089  * elif data_type_name == b'float128': # <<<<<<<<<<<<<<
4090  *
4091  * all_converged = _pyc_trace_estimator_long_double(
4092  */
4093  __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
4094  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
4095  if (likely(__pyx_t_1)) {
4096 
4097  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":131
4098  * Aop,
4099  * parameters,
4100  * num_inquiries, # <<<<<<<<<<<<<<
4101  * py_matrix_function,
4102  * exponent,
4103  */
4104  __Pyx_TraceLine(131,0,__PYX_ERR(0, 131, __pyx_L1_error))
4105  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_num_inquiries); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4106 
4107  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":133
4108  * num_inquiries,
4109  * py_matrix_function,
4110  * exponent, # <<<<<<<<<<<<<<
4111  * int(symmetric),
4112  * reorthogonalize,
4113  */
4114  __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
4115  __pyx_t_33 = __pyx_PyFloat_AsDouble(__pyx_v_exponent); if (unlikely((__pyx_t_33 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
4116 
4117  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":134
4118  * py_matrix_function,
4119  * exponent,
4120  * int(symmetric), # <<<<<<<<<<<<<<
4121  * reorthogonalize,
4122  * lanczos_degree,
4123  */
4124  __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error))
4125  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_symmetric); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
4126  __Pyx_GOTREF(__pyx_t_4);
4127  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
4128  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4129 
4130  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":135
4131  * exponent,
4132  * int(symmetric),
4133  * reorthogonalize, # <<<<<<<<<<<<<<
4134  * lanczos_degree,
4135  * lanczos_tol,
4136  */
4137  __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
4138  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_reorthogonalize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4139 
4140  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":136
4141  * int(symmetric),
4142  * reorthogonalize,
4143  * lanczos_degree, # <<<<<<<<<<<<<<
4144  * lanczos_tol,
4145  * min_num_samples,
4146  */
4147  __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error))
4148  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_lanczos_degree); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
4149 
4150  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":137
4151  * reorthogonalize,
4152  * lanczos_degree,
4153  * lanczos_tol, # <<<<<<<<<<<<<<
4154  * min_num_samples,
4155  * max_num_samples,
4156  */
4157  __Pyx_TraceLine(137,0,__PYX_ERR(0, 137, __pyx_L1_error))
4158  __pyx_t_34 = __pyx_PyFloat_AsDouble(__pyx_v_lanczos_tol); if (unlikely((__pyx_t_34 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
4159 
4160  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":138
4161  * lanczos_degree,
4162  * lanczos_tol,
4163  * min_num_samples, # <<<<<<<<<<<<<<
4164  * max_num_samples,
4165  * error_atol,
4166  */
4167  __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
4168  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_min_num_samples); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L1_error)
4169 
4170  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":139
4171  * lanczos_tol,
4172  * min_num_samples,
4173  * max_num_samples, # <<<<<<<<<<<<<<
4174  * error_atol,
4175  * error_rtol,
4176  */
4177  __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
4178  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error)
4179 
4180  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":140
4181  * min_num_samples,
4182  * max_num_samples,
4183  * error_atol, # <<<<<<<<<<<<<<
4184  * error_rtol,
4185  * confidence_level,
4186  */
4187  __Pyx_TraceLine(140,0,__PYX_ERR(0, 140, __pyx_L1_error))
4188  __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_v_error_atol); if (unlikely((__pyx_t_35 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
4189 
4190  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":141
4191  * max_num_samples,
4192  * error_atol,
4193  * error_rtol, # <<<<<<<<<<<<<<
4194  * confidence_level,
4195  * outlier_significance_level,
4196  */
4197  __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error))
4198  __pyx_t_36 = __pyx_PyFloat_AsDouble(__pyx_v_error_rtol); if (unlikely((__pyx_t_36 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
4199 
4200  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":142
4201  * error_atol,
4202  * error_rtol,
4203  * confidence_level, # <<<<<<<<<<<<<<
4204  * outlier_significance_level,
4205  * num_threads,
4206  */
4207  __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
4208  __pyx_t_37 = __pyx_PyFloat_AsDouble(__pyx_v_confidence_level); if (unlikely((__pyx_t_37 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error)
4209 
4210  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":143
4211  * error_rtol,
4212  * confidence_level,
4213  * outlier_significance_level, # <<<<<<<<<<<<<<
4214  * num_threads,
4215  * trace,
4216  */
4217  __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error))
4218  __pyx_t_38 = __pyx_PyFloat_AsDouble(__pyx_v_outlier_significance_level); if (unlikely((__pyx_t_38 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
4219 
4220  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":144
4221  * confidence_level,
4222  * outlier_significance_level,
4223  * num_threads, # <<<<<<<<<<<<<<
4224  * trace,
4225  * error,
4226  */
4227  __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error))
4228  __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error)
4229 
4230  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":145
4231  * outlier_significance_level,
4232  * num_threads,
4233  * trace, # <<<<<<<<<<<<<<
4234  * error,
4235  * samples,
4236  */
4237  __Pyx_TraceLine(145,0,__PYX_ERR(0, 145, __pyx_L1_error))
4238  __pyx_t_39 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_trace, PyBUF_WRITABLE); if (unlikely(!__pyx_t_39.memview)) __PYX_ERR(0, 145, __pyx_L1_error)
4239 
4240  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":146
4241  * num_threads,
4242  * trace,
4243  * error, # <<<<<<<<<<<<<<
4244  * samples,
4245  * processed_samples_indices,
4246  */
4247  __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
4248  __pyx_t_40 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_error, PyBUF_WRITABLE); if (unlikely(!__pyx_t_40.memview)) __PYX_ERR(0, 146, __pyx_L1_error)
4249 
4250  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":147
4251  * trace,
4252  * error,
4253  * samples, # <<<<<<<<<<<<<<
4254  * processed_samples_indices,
4255  * num_samples_used,
4256  */
4257  __Pyx_TraceLine(147,0,__PYX_ERR(0, 147, __pyx_L1_error))
4258  __pyx_t_41 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_samples, PyBUF_WRITABLE); if (unlikely(!__pyx_t_41.memview)) __PYX_ERR(0, 147, __pyx_L1_error)
4259 
4260  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":148
4261  * error,
4262  * samples,
4263  * processed_samples_indices, # <<<<<<<<<<<<<<
4264  * num_samples_used,
4265  * num_outliers,
4266  */
4267  __Pyx_TraceLine(148,0,__PYX_ERR(0, 148, __pyx_L1_error))
4268  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_processed_samples_indices, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4269 
4270  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":149
4271  * samples,
4272  * processed_samples_indices,
4273  * num_samples_used, # <<<<<<<<<<<<<<
4274  * num_outliers,
4275  * converged,
4276  */
4277  __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
4278  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_samples_used, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 149, __pyx_L1_error)
4279 
4280  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":150
4281  * processed_samples_indices,
4282  * num_samples_used,
4283  * num_outliers, # <<<<<<<<<<<<<<
4284  * converged,
4285  * alg_wall_time)
4286  */
4287  __Pyx_TraceLine(150,0,__PYX_ERR(0, 150, __pyx_L1_error))
4288  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_outliers, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 150, __pyx_L1_error)
4289 
4290  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":151
4291  * num_samples_used,
4292  * num_outliers,
4293  * converged, # <<<<<<<<<<<<<<
4294  * alg_wall_time)
4295  *
4296  */
4297  __Pyx_TraceLine(151,0,__PYX_ERR(0, 151, __pyx_L1_error))
4298  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_converged, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 151, __pyx_L1_error)
4299 
4300  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":128
4301  * elif data_type_name == b'float128':
4302  *
4303  * all_converged = _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
4304  * Aop,
4305  * parameters,
4306  */
4307  __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
4308  __pyx_t_23 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_long_double(__pyx_v_Aop, __pyx_v_parameters, __pyx_t_2, __pyx_v_py_matrix_function, __pyx_t_33, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_34, __pyx_t_9, __pyx_t_10, __pyx_t_35, __pyx_t_36, __pyx_t_37, __pyx_t_38, __pyx_t_15, __pyx_t_39, __pyx_t_40, __pyx_t_41, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_v_alg_wall_time); if (unlikely(__pyx_t_23 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
4309  __PYX_XDEC_MEMVIEW(&__pyx_t_39, 1);
4310  __pyx_t_39.memview = NULL;
4311  __pyx_t_39.data = NULL;
4312  __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1);
4313  __pyx_t_40.memview = NULL;
4314  __pyx_t_40.data = NULL;
4315  __PYX_XDEC_MEMVIEW(&__pyx_t_41, 1);
4316  __pyx_t_41.memview = NULL;
4317  __pyx_t_41.data = NULL;
4318  __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
4319  __pyx_t_19.memview = NULL;
4320  __pyx_t_19.data = NULL;
4321  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4322  __pyx_t_20.memview = NULL;
4323  __pyx_t_20.data = NULL;
4324  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4325  __pyx_t_21.memview = NULL;
4326  __pyx_t_21.data = NULL;
4327  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4328  __pyx_t_22.memview = NULL;
4329  __pyx_t_22.data = NULL;
4330  __pyx_v_all_converged = __pyx_t_23;
4331 
4332  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":126
4333  * alg_wall_time)
4334  *
4335  * elif data_type_name == b'float128': # <<<<<<<<<<<<<<
4336  *
4337  * all_converged = _pyc_trace_estimator_long_double(
4338  */
4339  goto __pyx_L3;
4340  }
4341 
4342  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":155
4343  *
4344  * else:
4345  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
4346  * '"float128".')
4347  *
4348  */
4349  __Pyx_TraceLine(155,0,__PYX_ERR(0, 155, __pyx_L1_error))
4350  /*else*/ {
4351  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
4352  __Pyx_GOTREF(__pyx_t_4);
4353  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
4354  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4355  __PYX_ERR(0, 155, __pyx_L1_error)
4356  }
4357  __pyx_L3:;
4358 
4359  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":159
4360  *
4361  * # Return gpu proc time via a numpy array of size 1
4362  * alg_wall_times[0] = alg_wall_time # <<<<<<<<<<<<<<
4363  *
4364  * return all_converged
4365  */
4366  __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
4367  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_alg_wall_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
4368  __Pyx_GOTREF(__pyx_t_4);
4369  if (unlikely(__Pyx_SetItemInt(__pyx_v_alg_wall_times, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
4370  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4371 
4372  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":161
4373  * alg_wall_times[0] = alg_wall_time
4374  *
4375  * return all_converged # <<<<<<<<<<<<<<
4376  *
4377  *
4378  */
4379  __Pyx_TraceLine(161,0,__PYX_ERR(0, 161, __pyx_L1_error))
4380  __pyx_r = __pyx_v_all_converged;
4381  goto __pyx_L0;
4382 
4383  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":38
4384  * # ===================
4385  *
4386  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
4387  * pycLinearOperator Aop,
4388  * parameters,
4389  */
4390 
4391  /* function exit code */
4392  __pyx_L1_error:;
4393  __Pyx_XDECREF(__pyx_t_4);
4394  __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
4395  __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
4396  __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
4397  __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
4398  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4399  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4400  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4401  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
4402  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
4403  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
4404  __PYX_XDEC_MEMVIEW(&__pyx_t_39, 1);
4405  __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1);
4406  __PYX_XDEC_MEMVIEW(&__pyx_t_41, 1);
4407  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator.pyc_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
4408  __pyx_r = -1;
4409  __pyx_L0:;
4410  __Pyx_TraceReturn(Py_None, 0);
4411  __Pyx_RefNannyFinishContext();
4412  return __pyx_r;
4413 }
4414 
4415 /* Python wrapper */
4416 static PyObject *__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4417 static char __pyx_doc_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator[] = "pyc_trace_estimator(pycLinearOperator Aop, parameters, num_inquiries, pyFunction py_matrix_function, exponent, symmetric, reorthogonalize, lanczos_degree, lanczos_tol, min_num_samples, max_num_samples, error_atol, error_rtol, confidence_level, outlier_significance_level, num_threads, data_type_name, trace, error, samples, processed_samples_indices, num_samples_used, num_outliers, converged, alg_wall_times) -> FlagType\n\n ";
4418 static PyMethodDef __pyx_mdef_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator = {"pyc_trace_estimator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator};
4419 static PyObject *__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4420  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop = 0;
4421  PyObject *__pyx_v_parameters = 0;
4422  PyObject *__pyx_v_num_inquiries = 0;
4423  struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function = 0;
4424  PyObject *__pyx_v_exponent = 0;
4425  PyObject *__pyx_v_symmetric = 0;
4426  PyObject *__pyx_v_reorthogonalize = 0;
4427  PyObject *__pyx_v_lanczos_degree = 0;
4428  PyObject *__pyx_v_lanczos_tol = 0;
4429  PyObject *__pyx_v_min_num_samples = 0;
4430  PyObject *__pyx_v_max_num_samples = 0;
4431  PyObject *__pyx_v_error_atol = 0;
4432  PyObject *__pyx_v_error_rtol = 0;
4433  PyObject *__pyx_v_confidence_level = 0;
4434  PyObject *__pyx_v_outlier_significance_level = 0;
4435  PyObject *__pyx_v_num_threads = 0;
4436  PyObject *__pyx_v_data_type_name = 0;
4437  PyObject *__pyx_v_trace = 0;
4438  PyObject *__pyx_v_error = 0;
4439  PyObject *__pyx_v_samples = 0;
4440  PyObject *__pyx_v_processed_samples_indices = 0;
4441  PyObject *__pyx_v_num_samples_used = 0;
4442  PyObject *__pyx_v_num_outliers = 0;
4443  PyObject *__pyx_v_converged = 0;
4444  PyObject *__pyx_v_alg_wall_times = 0;
4445  int __pyx_lineno = 0;
4446  const char *__pyx_filename = NULL;
4447  int __pyx_clineno = 0;
4448  PyObject *__pyx_r = 0;
4449  __Pyx_RefNannyDeclarations
4450  __Pyx_RefNannySetupContext("pyc_trace_estimator (wrapper)", 0);
4451  {
4452  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Aop,&__pyx_n_s_parameters,&__pyx_n_s_num_inquiries,&__pyx_n_s_py_matrix_function,&__pyx_n_s_exponent,&__pyx_n_s_symmetric,&__pyx_n_s_reorthogonalize,&__pyx_n_s_lanczos_degree,&__pyx_n_s_lanczos_tol,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_num_threads,&__pyx_n_s_data_type_name,&__pyx_n_s_trace,&__pyx_n_s_error,&__pyx_n_s_samples,&__pyx_n_s_processed_samples_indices,&__pyx_n_s_num_samples_used,&__pyx_n_s_num_outliers,&__pyx_n_s_converged,&__pyx_n_s_alg_wall_times,0};
4453  PyObject* values[25] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4454  if (unlikely(__pyx_kwds)) {
4455  Py_ssize_t kw_args;
4456  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4457  switch (pos_args) {
4458  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
4459  CYTHON_FALLTHROUGH;
4460  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
4461  CYTHON_FALLTHROUGH;
4462  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
4463  CYTHON_FALLTHROUGH;
4464  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
4465  CYTHON_FALLTHROUGH;
4466  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
4467  CYTHON_FALLTHROUGH;
4468  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4469  CYTHON_FALLTHROUGH;
4470  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4471  CYTHON_FALLTHROUGH;
4472  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4473  CYTHON_FALLTHROUGH;
4474  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4475  CYTHON_FALLTHROUGH;
4476  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4477  CYTHON_FALLTHROUGH;
4478  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4479  CYTHON_FALLTHROUGH;
4480  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4481  CYTHON_FALLTHROUGH;
4482  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4483  CYTHON_FALLTHROUGH;
4484  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4485  CYTHON_FALLTHROUGH;
4486  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4487  CYTHON_FALLTHROUGH;
4488  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4489  CYTHON_FALLTHROUGH;
4490  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4491  CYTHON_FALLTHROUGH;
4492  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4493  CYTHON_FALLTHROUGH;
4494  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4495  CYTHON_FALLTHROUGH;
4496  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4497  CYTHON_FALLTHROUGH;
4498  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4499  CYTHON_FALLTHROUGH;
4500  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4501  CYTHON_FALLTHROUGH;
4502  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4503  CYTHON_FALLTHROUGH;
4504  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4505  CYTHON_FALLTHROUGH;
4506  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4507  CYTHON_FALLTHROUGH;
4508  case 0: break;
4509  default: goto __pyx_L5_argtuple_error;
4510  }
4511  kw_args = PyDict_Size(__pyx_kwds);
4512  switch (pos_args) {
4513  case 0:
4514  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Aop)) != 0)) kw_args--;
4515  else goto __pyx_L5_argtuple_error;
4516  CYTHON_FALLTHROUGH;
4517  case 1:
4518  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parameters)) != 0)) kw_args--;
4519  else {
4520  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 1); __PYX_ERR(0, 38, __pyx_L3_error)
4521  }
4522  CYTHON_FALLTHROUGH;
4523  case 2:
4524  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_inquiries)) != 0)) kw_args--;
4525  else {
4526  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 2); __PYX_ERR(0, 38, __pyx_L3_error)
4527  }
4528  CYTHON_FALLTHROUGH;
4529  case 3:
4530  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_matrix_function)) != 0)) kw_args--;
4531  else {
4532  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 3); __PYX_ERR(0, 38, __pyx_L3_error)
4533  }
4534  CYTHON_FALLTHROUGH;
4535  case 4:
4536  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exponent)) != 0)) kw_args--;
4537  else {
4538  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 4); __PYX_ERR(0, 38, __pyx_L3_error)
4539  }
4540  CYTHON_FALLTHROUGH;
4541  case 5:
4542  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symmetric)) != 0)) kw_args--;
4543  else {
4544  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 5); __PYX_ERR(0, 38, __pyx_L3_error)
4545  }
4546  CYTHON_FALLTHROUGH;
4547  case 6:
4548  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reorthogonalize)) != 0)) kw_args--;
4549  else {
4550  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 6); __PYX_ERR(0, 38, __pyx_L3_error)
4551  }
4552  CYTHON_FALLTHROUGH;
4553  case 7:
4554  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lanczos_degree)) != 0)) kw_args--;
4555  else {
4556  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 7); __PYX_ERR(0, 38, __pyx_L3_error)
4557  }
4558  CYTHON_FALLTHROUGH;
4559  case 8:
4560  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lanczos_tol)) != 0)) kw_args--;
4561  else {
4562  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 8); __PYX_ERR(0, 38, __pyx_L3_error)
4563  }
4564  CYTHON_FALLTHROUGH;
4565  case 9:
4566  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples)) != 0)) kw_args--;
4567  else {
4568  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 9); __PYX_ERR(0, 38, __pyx_L3_error)
4569  }
4570  CYTHON_FALLTHROUGH;
4571  case 10:
4572  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples)) != 0)) kw_args--;
4573  else {
4574  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 10); __PYX_ERR(0, 38, __pyx_L3_error)
4575  }
4576  CYTHON_FALLTHROUGH;
4577  case 11:
4578  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol)) != 0)) kw_args--;
4579  else {
4580  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 11); __PYX_ERR(0, 38, __pyx_L3_error)
4581  }
4582  CYTHON_FALLTHROUGH;
4583  case 12:
4584  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol)) != 0)) kw_args--;
4585  else {
4586  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 12); __PYX_ERR(0, 38, __pyx_L3_error)
4587  }
4588  CYTHON_FALLTHROUGH;
4589  case 13:
4590  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level)) != 0)) kw_args--;
4591  else {
4592  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 13); __PYX_ERR(0, 38, __pyx_L3_error)
4593  }
4594  CYTHON_FALLTHROUGH;
4595  case 14:
4596  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level)) != 0)) kw_args--;
4597  else {
4598  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 14); __PYX_ERR(0, 38, __pyx_L3_error)
4599  }
4600  CYTHON_FALLTHROUGH;
4601  case 15:
4602  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--;
4603  else {
4604  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 15); __PYX_ERR(0, 38, __pyx_L3_error)
4605  }
4606  CYTHON_FALLTHROUGH;
4607  case 16:
4608  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data_type_name)) != 0)) kw_args--;
4609  else {
4610  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 16); __PYX_ERR(0, 38, __pyx_L3_error)
4611  }
4612  CYTHON_FALLTHROUGH;
4613  case 17:
4614  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace)) != 0)) kw_args--;
4615  else {
4616  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 17); __PYX_ERR(0, 38, __pyx_L3_error)
4617  }
4618  CYTHON_FALLTHROUGH;
4619  case 18:
4620  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
4621  else {
4622  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 18); __PYX_ERR(0, 38, __pyx_L3_error)
4623  }
4624  CYTHON_FALLTHROUGH;
4625  case 19:
4626  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
4627  else {
4628  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 19); __PYX_ERR(0, 38, __pyx_L3_error)
4629  }
4630  CYTHON_FALLTHROUGH;
4631  case 20:
4632  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_processed_samples_indices)) != 0)) kw_args--;
4633  else {
4634  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 20); __PYX_ERR(0, 38, __pyx_L3_error)
4635  }
4636  CYTHON_FALLTHROUGH;
4637  case 21:
4638  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_samples_used)) != 0)) kw_args--;
4639  else {
4640  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 21); __PYX_ERR(0, 38, __pyx_L3_error)
4641  }
4642  CYTHON_FALLTHROUGH;
4643  case 22:
4644  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_outliers)) != 0)) kw_args--;
4645  else {
4646  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 22); __PYX_ERR(0, 38, __pyx_L3_error)
4647  }
4648  CYTHON_FALLTHROUGH;
4649  case 23:
4650  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_converged)) != 0)) kw_args--;
4651  else {
4652  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 23); __PYX_ERR(0, 38, __pyx_L3_error)
4653  }
4654  CYTHON_FALLTHROUGH;
4655  case 24:
4656  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg_wall_times)) != 0)) kw_args--;
4657  else {
4658  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, 24); __PYX_ERR(0, 38, __pyx_L3_error)
4659  }
4660  }
4661  if (unlikely(kw_args > 0)) {
4662  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pyc_trace_estimator") < 0)) __PYX_ERR(0, 38, __pyx_L3_error)
4663  }
4664  } else if (PyTuple_GET_SIZE(__pyx_args) != 25) {
4665  goto __pyx_L5_argtuple_error;
4666  } else {
4667  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4668  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4669  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4670  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4671  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4672  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4673  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4674  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4675  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4676  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4677  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4678  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4679  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4680  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4681  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4682  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4683  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4684  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4685  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4686  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4687  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
4688  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
4689  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
4690  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
4691  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
4692  }
4693  __pyx_v_Aop = ((struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)values[0]);
4694  __pyx_v_parameters = values[1];
4695  __pyx_v_num_inquiries = values[2];
4696  __pyx_v_py_matrix_function = ((struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *)values[3]);
4697  __pyx_v_exponent = values[4];
4698  __pyx_v_symmetric = values[5];
4699  __pyx_v_reorthogonalize = values[6];
4700  __pyx_v_lanczos_degree = values[7];
4701  __pyx_v_lanczos_tol = values[8];
4702  __pyx_v_min_num_samples = values[9];
4703  __pyx_v_max_num_samples = values[10];
4704  __pyx_v_error_atol = values[11];
4705  __pyx_v_error_rtol = values[12];
4706  __pyx_v_confidence_level = values[13];
4707  __pyx_v_outlier_significance_level = values[14];
4708  __pyx_v_num_threads = values[15];
4709  __pyx_v_data_type_name = values[16];
4710  __pyx_v_trace = values[17];
4711  __pyx_v_error = values[18];
4712  __pyx_v_samples = values[19];
4713  __pyx_v_processed_samples_indices = values[20];
4714  __pyx_v_num_samples_used = values[21];
4715  __pyx_v_num_outliers = values[22];
4716  __pyx_v_converged = values[23];
4717  __pyx_v_alg_wall_times = values[24];
4718  }
4719  goto __pyx_L4_argument_unpacking_done;
4720  __pyx_L5_argtuple_error:;
4721  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 25, 25, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 38, __pyx_L3_error)
4722  __pyx_L3_error:;
4723  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator.pyc_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
4724  __Pyx_RefNannyFinishContext();
4725  return NULL;
4726  __pyx_L4_argument_unpacking_done:;
4727  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Aop), __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator, 1, "Aop", 0))) __PYX_ERR(0, 39, __pyx_L1_error)
4728  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py_matrix_function), __pyx_ptype_5imate_9functions_12py_functions_pyFunction, 1, "py_matrix_function", 0))) __PYX_ERR(0, 42, __pyx_L1_error)
4729  __pyx_r = __pyx_pf_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(__pyx_self, __pyx_v_Aop, __pyx_v_parameters, __pyx_v_num_inquiries, __pyx_v_py_matrix_function, __pyx_v_exponent, __pyx_v_symmetric, __pyx_v_reorthogonalize, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_data_type_name, __pyx_v_trace, __pyx_v_error, __pyx_v_samples, __pyx_v_processed_samples_indices, __pyx_v_num_samples_used, __pyx_v_num_outliers, __pyx_v_converged, __pyx_v_alg_wall_times);
4730 
4731  /* function exit code */
4732  goto __pyx_L0;
4733  __pyx_L1_error:;
4734  __pyx_r = NULL;
4735  __pyx_L0:;
4736  __Pyx_RefNannyFinishContext();
4737  return __pyx_r;
4738 }
4739 
4740 static PyObject *__pyx_pf_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, PyObject *__pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, PyObject *__pyx_v_exponent, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_reorthogonalize, PyObject *__pyx_v_lanczos_degree, PyObject *__pyx_v_lanczos_tol, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_data_type_name, PyObject *__pyx_v_trace, PyObject *__pyx_v_error, PyObject *__pyx_v_samples, PyObject *__pyx_v_processed_samples_indices, PyObject *__pyx_v_num_samples_used, PyObject *__pyx_v_num_outliers, PyObject *__pyx_v_converged, PyObject *__pyx_v_alg_wall_times) {
4741  PyObject *__pyx_r = NULL;
4742  __Pyx_TraceDeclarations
4743  __Pyx_RefNannyDeclarations
4744  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_1;
4745  PyObject *__pyx_t_2 = NULL;
4746  int __pyx_lineno = 0;
4747  const char *__pyx_filename = NULL;
4748  int __pyx_clineno = 0;
4749  __Pyx_TraceFrameInit(__pyx_codeobj_)
4750  __Pyx_RefNannySetupContext("pyc_trace_estimator", 0);
4751  __Pyx_TraceCall("pyc_trace_estimator (wrapper)", __pyx_f[0], 38, 0, __PYX_ERR(0, 38, __pyx_L1_error));
4752  __Pyx_XDECREF(__pyx_r);
4753  __pyx_t_1 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(__pyx_v_Aop, __pyx_v_parameters, __pyx_v_num_inquiries, __pyx_v_py_matrix_function, __pyx_v_exponent, __pyx_v_symmetric, __pyx_v_reorthogonalize, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_data_type_name, __pyx_v_trace, __pyx_v_error, __pyx_v_samples, __pyx_v_processed_samples_indices, __pyx_v_num_samples_used, __pyx_v_num_outliers, __pyx_v_converged, __pyx_v_alg_wall_times, 0); if (unlikely(__pyx_t_1 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error)
4754  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
4755  __Pyx_GOTREF(__pyx_t_2);
4756  __pyx_r = __pyx_t_2;
4757  __pyx_t_2 = 0;
4758  goto __pyx_L0;
4759 
4760  /* function exit code */
4761  __pyx_L1_error:;
4762  __Pyx_XDECREF(__pyx_t_2);
4763  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator.pyc_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
4764  __pyx_r = NULL;
4765  __pyx_L0:;
4766  __Pyx_XGIVEREF(__pyx_r);
4767  __Pyx_TraceReturn(__pyx_r, 0);
4768  __Pyx_RefNannyFinishContext();
4769  return __pyx_r;
4770 }
4771 
4772 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":168
4773  * # =========================
4774  *
4775  * cdef FlagType _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
4776  * pycLinearOperator Aop,
4777  * parameters,
4778  */
4779 
4780 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_float(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, float const __pyx_v_exponent, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_symmetric, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_reorthogonalize, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_lanczos_degree, float const __pyx_v_lanczos_tol, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_min_num_samples, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_max_num_samples, float const __pyx_v_error_atol, float const __pyx_v_error_rtol, float const __pyx_v_confidence_level, float const __pyx_v_outlier_significance_level, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_threads, __Pyx_memviewslice __pyx_v_trace, __Pyx_memviewslice __pyx_v_error, __Pyx_memviewslice __pyx_v_samples, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_processed_samples_indices, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_samples_used, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_outliers, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_v_converged, float &__pyx_v_alg_wall_time) {
4781  float *__pyx_v_c_parameters;
4782  float __pyx_v_scalar_parameters;
4783  __Pyx_memviewslice __pyx_v_array_parameters = { 0, 0, { 0 }, { 0 }, { 0 } };
4784  float *__pyx_v_c_trace;
4785  float *__pyx_v_c_error;
4786  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_processed_samples_indices;
4787  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_samples_used;
4788  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_outliers;
4789  __pyx_t_5imate_12_definitions_5types_FlagType *__pyx_v_c_converged;
4790  float **__pyx_v_c_samples;
4791  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_i;
4792  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_j;
4793  cLinearOperator<float> *__pyx_v_Aop_float;
4794  Function *__pyx_v_matrix_function;
4795  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
4796  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
4797  __Pyx_TraceDeclarations
4798  __Pyx_RefNannyDeclarations
4799  int __pyx_t_1;
4800  int __pyx_t_2;
4801  PyObject *__pyx_t_3 = NULL;
4802  PyObject *__pyx_t_4 = NULL;
4803  PyObject *__pyx_t_5 = NULL;
4804  float __pyx_t_6;
4805  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
4806  Py_ssize_t __pyx_t_8;
4807  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_9;
4808  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
4809  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
4810  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
4811  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_13;
4812  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_14;
4813  cLinearOperator<float> *__pyx_t_15;
4814  int __pyx_t_16;
4815  int __pyx_t_17;
4816  Py_ssize_t __pyx_t_18;
4817  Py_ssize_t __pyx_t_19;
4818  int __pyx_lineno = 0;
4819  const char *__pyx_filename = NULL;
4820  int __pyx_clineno = 0;
4821  __Pyx_RefNannySetupContext("_pyc_trace_estimator_float", 0);
4822  __Pyx_TraceCall("_pyc_trace_estimator_float", __pyx_f[0], 168, 0, __PYX_ERR(0, 168, __pyx_L1_error));
4823 
4824  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":201
4825  * cdef float[:] array_parameters
4826  *
4827  * if parameters is None: # <<<<<<<<<<<<<<
4828  * c_parameters = NULL
4829  *
4830  */
4831  __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error))
4832  __pyx_t_1 = (__pyx_v_parameters == Py_None);
4833  __pyx_t_2 = (__pyx_t_1 != 0);
4834  if (__pyx_t_2) {
4835 
4836  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":202
4837  *
4838  * if parameters is None:
4839  * c_parameters = NULL # <<<<<<<<<<<<<<
4840  *
4841  * elif numpy.isscalar(parameters):
4842  */
4843  __Pyx_TraceLine(202,0,__PYX_ERR(0, 202, __pyx_L1_error))
4844  __pyx_v_c_parameters = NULL;
4845 
4846  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":201
4847  * cdef float[:] array_parameters
4848  *
4849  * if parameters is None: # <<<<<<<<<<<<<<
4850  * c_parameters = NULL
4851  *
4852  */
4853  goto __pyx_L3;
4854  }
4855 
4856  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":204
4857  * c_parameters = NULL
4858  *
4859  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
4860  * scalar_parameters = parameters
4861  * c_parameters = &scalar_parameters
4862  */
4863  __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
4864  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
4865  __Pyx_GOTREF(__pyx_t_4);
4866  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
4867  __Pyx_GOTREF(__pyx_t_5);
4868  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4869  __pyx_t_4 = NULL;
4870  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4871  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
4872  if (likely(__pyx_t_4)) {
4873  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4874  __Pyx_INCREF(__pyx_t_4);
4875  __Pyx_INCREF(function);
4876  __Pyx_DECREF_SET(__pyx_t_5, function);
4877  }
4878  }
4879  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_parameters) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_parameters);
4880  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4881  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
4882  __Pyx_GOTREF(__pyx_t_3);
4883  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4884  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
4885  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4886  if (__pyx_t_2) {
4887 
4888  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":205
4889  *
4890  * elif numpy.isscalar(parameters):
4891  * scalar_parameters = parameters # <<<<<<<<<<<<<<
4892  * c_parameters = &scalar_parameters
4893  *
4894  */
4895  __Pyx_TraceLine(205,0,__PYX_ERR(0, 205, __pyx_L1_error))
4896  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_parameters); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
4897  __pyx_v_scalar_parameters = __pyx_t_6;
4898 
4899  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":206
4900  * elif numpy.isscalar(parameters):
4901  * scalar_parameters = parameters
4902  * c_parameters = &scalar_parameters # <<<<<<<<<<<<<<
4903  *
4904  * else:
4905  */
4906  __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error))
4907  __pyx_v_c_parameters = (&__pyx_v_scalar_parameters);
4908 
4909  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":204
4910  * c_parameters = NULL
4911  *
4912  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
4913  * scalar_parameters = parameters
4914  * c_parameters = &scalar_parameters
4915  */
4916  goto __pyx_L3;
4917  }
4918 
4919  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":209
4920  *
4921  * else:
4922  * array_parameters = parameters # <<<<<<<<<<<<<<
4923  * c_parameters = &array_parameters[0]
4924  *
4925  */
4926  __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
4927  /*else*/ {
4928  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_parameters, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 209, __pyx_L1_error)
4929  __pyx_v_array_parameters = __pyx_t_7;
4930  __pyx_t_7.memview = NULL;
4931  __pyx_t_7.data = NULL;
4932 
4933  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":210
4934  * else:
4935  * array_parameters = parameters
4936  * c_parameters = &array_parameters[0] # <<<<<<<<<<<<<<
4937  *
4938  * # C pointers from memoryviews
4939  */
4940  __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
4941  __pyx_t_8 = 0;
4942  __pyx_v_c_parameters = (&(*((float *) ( /* dim=0 */ (__pyx_v_array_parameters.data + __pyx_t_8 * __pyx_v_array_parameters.strides[0]) ))));
4943  }
4944  __pyx_L3:;
4945 
4946  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":213
4947  *
4948  * # C pointers from memoryviews
4949  * cdef float* c_trace = &trace[0] # <<<<<<<<<<<<<<
4950  * cdef float* c_error = &error[0]
4951  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4952  */
4953  __Pyx_TraceLine(213,0,__PYX_ERR(0, 213, __pyx_L1_error))
4954  __pyx_t_8 = 0;
4955  __pyx_v_c_trace = (&(*((float *) ( /* dim=0 */ (__pyx_v_trace.data + __pyx_t_8 * __pyx_v_trace.strides[0]) ))));
4956 
4957  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":214
4958  * # C pointers from memoryviews
4959  * cdef float* c_trace = &trace[0]
4960  * cdef float* c_error = &error[0] # <<<<<<<<<<<<<<
4961  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4962  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
4963  */
4964  __Pyx_TraceLine(214,0,__PYX_ERR(0, 214, __pyx_L1_error))
4965  __pyx_t_8 = 0;
4966  __pyx_v_c_error = (&(*((float *) ( /* dim=0 */ (__pyx_v_error.data + __pyx_t_8 * __pyx_v_error.strides[0]) ))));
4967 
4968  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":215
4969  * cdef float* c_trace = &trace[0]
4970  * cdef float* c_error = &error[0]
4971  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0] # <<<<<<<<<<<<<<
4972  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
4973  * cdef IndexType* c_num_outliers = &num_outliers[0]
4974  */
4975  __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
4976  __pyx_t_8 = 0;
4977  __pyx_v_c_processed_samples_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) ))));
4978 
4979  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":216
4980  * cdef float* c_error = &error[0]
4981  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4982  * cdef IndexType* c_num_samples_used = &num_samples_used[0] # <<<<<<<<<<<<<<
4983  * cdef IndexType* c_num_outliers = &num_outliers[0]
4984  * cdef FlagType* c_converged = &converged[0]
4985  */
4986  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
4987  __pyx_t_8 = 0;
4988  __pyx_v_c_num_samples_used = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) ))));
4989 
4990  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":217
4991  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4992  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
4993  * cdef IndexType* c_num_outliers = &num_outliers[0] # <<<<<<<<<<<<<<
4994  * cdef FlagType* c_converged = &converged[0]
4995  *
4996  */
4997  __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error))
4998  __pyx_t_8 = 0;
4999  __pyx_v_c_num_outliers = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_outliers.data + __pyx_t_8 * __pyx_v_num_outliers.strides[0]) ))));
5000 
5001  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":218
5002  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5003  * cdef IndexType* c_num_outliers = &num_outliers[0]
5004  * cdef FlagType* c_converged = &converged[0] # <<<<<<<<<<<<<<
5005  *
5006  * # For samples array, instead of memoryview, allocate a 2D C array
5007  */
5008  __Pyx_TraceLine(218,0,__PYX_ERR(0, 218, __pyx_L1_error))
5009  __pyx_t_8 = 0;
5010  __pyx_v_c_converged = (&(*((int *) ( /* dim=0 */ (__pyx_v_converged.data + __pyx_t_8 * __pyx_v_converged.strides[0]) ))));
5011 
5012  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":222
5013  * # For samples array, instead of memoryview, allocate a 2D C array
5014  * cdef float** c_samples = \
5015  * <float**> malloc(sizeof(float*) * max_num_samples) # <<<<<<<<<<<<<<
5016  * cdef IndexType i, j
5017  * for i in range(max_num_samples):
5018  */
5019  __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
5020  __pyx_v_c_samples = ((float **)malloc(((sizeof(float *)) * __pyx_v_max_num_samples)));
5021 
5022  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":224
5023  * <float**> malloc(sizeof(float*) * max_num_samples)
5024  * cdef IndexType i, j
5025  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5026  * c_samples[i] = <float*> malloc(sizeof(float) * num_inquiries)
5027  *
5028  */
5029  __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error))
5030  __pyx_t_9 = __pyx_v_max_num_samples;
5031  __pyx_t_10 = __pyx_t_9;
5032  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5033  __pyx_v_i = __pyx_t_11;
5034 
5035  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":225
5036  * cdef IndexType i, j
5037  * for i in range(max_num_samples):
5038  * c_samples[i] = <float*> malloc(sizeof(float) * num_inquiries) # <<<<<<<<<<<<<<
5039  *
5040  * for j in range(num_inquiries):
5041  */
5042  __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
5043  (__pyx_v_c_samples[__pyx_v_i]) = ((float *)malloc(((sizeof(float)) * __pyx_v_num_inquiries)));
5044 
5045  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":227
5046  * c_samples[i] = <float*> malloc(sizeof(float) * num_inquiries)
5047  *
5048  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5049  * c_samples[i][j] = NAN
5050  *
5051  */
5052  __Pyx_TraceLine(227,0,__PYX_ERR(0, 227, __pyx_L1_error))
5053  __pyx_t_12 = __pyx_v_num_inquiries;
5054  __pyx_t_13 = __pyx_t_12;
5055  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5056  __pyx_v_j = __pyx_t_14;
5057 
5058  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":228
5059  *
5060  * for j in range(num_inquiries):
5061  * c_samples[i][j] = NAN # <<<<<<<<<<<<<<
5062  *
5063  * # Get cLinearOperator
5064  */
5065  __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error))
5066  ((__pyx_v_c_samples[__pyx_v_i])[__pyx_v_j]) = NAN;
5067  }
5068  }
5069 
5070  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":231
5071  *
5072  * # Get cLinearOperator
5073  * cdef cLinearOperator[float]* Aop_float = Aop.get_linear_operator_float() # <<<<<<<<<<<<<<
5074  *
5075  * cdef Function* matrix_function = py_matrix_function.get_function()
5076  */
5077  __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
5078  __pyx_t_15 = ((struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_Aop->__pyx_vtab)->get_linear_operator_float(__pyx_v_Aop); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
5079  __pyx_v_Aop_float = __pyx_t_15;
5080 
5081  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":233
5082  * cdef cLinearOperator[float]* Aop_float = Aop.get_linear_operator_float()
5083  *
5084  * cdef Function* matrix_function = py_matrix_function.get_function() # <<<<<<<<<<<<<<
5085  *
5086  * # Call templated c++ module
5087  */
5088  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
5089  __pyx_v_matrix_function = ((struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *)__pyx_v_py_matrix_function->__pyx_vtab)->get_function(__pyx_v_py_matrix_function);
5090 
5091  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":237
5092  * # Call templated c++ module
5093  * cdef FlagType all_converged = \
5094  * cTraceEstimator[float].c_trace_estimator( # <<<<<<<<<<<<<<
5095  * Aop_float,
5096  * c_parameters,
5097  */
5098  __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error))
5099  __pyx_v_all_converged = cTraceEstimator<float> ::c_trace_estimator(__pyx_v_Aop_float, __pyx_v_c_parameters, __pyx_v_num_inquiries, __pyx_v_matrix_function, __pyx_v_exponent, ((__pyx_t_5imate_12_definitions_5types_FlagType const )__pyx_v_symmetric), __pyx_v_reorthogonalize, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_c_trace, __pyx_v_c_error, __pyx_v_c_samples, __pyx_v_c_processed_samples_indices, __pyx_v_c_num_samples_used, __pyx_v_c_num_outliers, __pyx_v_c_converged, __pyx_v_alg_wall_time);
5100 
5101  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":265
5102  * # Write the processed samples to samples to a numpy array. The unprocessed
5103  * # elements of samples array is nan.
5104  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5105  * for i in range(num_samples_used[j]):
5106  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5107  */
5108  __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error))
5109  __pyx_t_9 = __pyx_v_num_inquiries;
5110  __pyx_t_10 = __pyx_t_9;
5111  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5112  __pyx_v_j = __pyx_t_11;
5113 
5114  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":266
5115  * # elements of samples array is nan.
5116  * for j in range(num_inquiries):
5117  * for i in range(num_samples_used[j]): # <<<<<<<<<<<<<<
5118  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5119  * # for i in range(max_num_samples):
5120  */
5121  __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error))
5122  __pyx_t_8 = __pyx_v_j;
5123  __pyx_t_16 = (*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) )));
5124  __pyx_t_17 = __pyx_t_16;
5125  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_17; __pyx_t_12+=1) {
5126  __pyx_v_i = __pyx_t_12;
5127 
5128  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":267
5129  * for j in range(num_inquiries):
5130  * for i in range(num_samples_used[j]):
5131  * samples[i, j] = c_samples[processed_samples_indices[i]][j] # <<<<<<<<<<<<<<
5132  * # for i in range(max_num_samples):
5133  * # samples[i, j] = c_samples[i][j]
5134  */
5135  __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error))
5136  __pyx_t_8 = __pyx_v_i;
5137  __pyx_t_18 = __pyx_v_i;
5138  __pyx_t_19 = __pyx_v_j;
5139  *((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )) + __pyx_t_19)) )) = ((__pyx_v_c_samples[(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) )))])[__pyx_v_j]);
5140  }
5141  }
5142 
5143  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":272
5144  *
5145  * # Deallocate dynamic memory
5146  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5147  * free(c_samples[i])
5148  * free(c_samples)
5149  */
5150  __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
5151  __pyx_t_9 = __pyx_v_max_num_samples;
5152  __pyx_t_10 = __pyx_t_9;
5153  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5154  __pyx_v_i = __pyx_t_11;
5155 
5156  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":273
5157  * # Deallocate dynamic memory
5158  * for i in range(max_num_samples):
5159  * free(c_samples[i]) # <<<<<<<<<<<<<<
5160  * free(c_samples)
5161  *
5162  */
5163  __Pyx_TraceLine(273,0,__PYX_ERR(0, 273, __pyx_L1_error))
5164  free((__pyx_v_c_samples[__pyx_v_i]));
5165  }
5166 
5167  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":274
5168  * for i in range(max_num_samples):
5169  * free(c_samples[i])
5170  * free(c_samples) # <<<<<<<<<<<<<<
5171  *
5172  * return all_converged
5173  */
5174  __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
5175  free(__pyx_v_c_samples);
5176 
5177  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":276
5178  * free(c_samples)
5179  *
5180  * return all_converged # <<<<<<<<<<<<<<
5181  *
5182  *
5183  */
5184  __Pyx_TraceLine(276,0,__PYX_ERR(0, 276, __pyx_L1_error))
5185  __pyx_r = __pyx_v_all_converged;
5186  goto __pyx_L0;
5187 
5188  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":168
5189  * # =========================
5190  *
5191  * cdef FlagType _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
5192  * pycLinearOperator Aop,
5193  * parameters,
5194  */
5195 
5196  /* function exit code */
5197  __pyx_L1_error:;
5198  __Pyx_XDECREF(__pyx_t_3);
5199  __Pyx_XDECREF(__pyx_t_4);
5200  __Pyx_XDECREF(__pyx_t_5);
5201  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5202  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator._pyc_trace_estimator_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5203  __pyx_r = -1;
5204  __pyx_L0:;
5205  __PYX_XDEC_MEMVIEW(&__pyx_v_array_parameters, 1);
5206  __Pyx_TraceReturn(Py_None, 0);
5207  __Pyx_RefNannyFinishContext();
5208  return __pyx_r;
5209 }
5210 
5211 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":283
5212  * # ==========================
5213  *
5214  * cdef FlagType _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
5215  * pycLinearOperator Aop,
5216  * parameters,
5217  */
5218 
5219 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, double const __pyx_v_exponent, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_symmetric, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_reorthogonalize, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_lanczos_degree, double const __pyx_v_lanczos_tol, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_min_num_samples, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_max_num_samples, double const __pyx_v_error_atol, double const __pyx_v_error_rtol, double const __pyx_v_confidence_level, double const __pyx_v_outlier_significance_level, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_threads, __Pyx_memviewslice __pyx_v_trace, __Pyx_memviewslice __pyx_v_error, __Pyx_memviewslice __pyx_v_samples, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_processed_samples_indices, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_samples_used, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_outliers, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_v_converged, float &__pyx_v_alg_wall_time) {
5220  double *__pyx_v_c_parameters;
5221  double __pyx_v_scalar_parameters;
5222  __Pyx_memviewslice __pyx_v_array_parameters = { 0, 0, { 0 }, { 0 }, { 0 } };
5223  double *__pyx_v_c_trace;
5224  double *__pyx_v_c_error;
5225  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_processed_samples_indices;
5226  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_samples_used;
5227  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_outliers;
5228  __pyx_t_5imate_12_definitions_5types_FlagType *__pyx_v_c_converged;
5229  double **__pyx_v_c_samples;
5230  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_i;
5231  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_j;
5232  cLinearOperator<double> *__pyx_v_Aop_double;
5233  Function *__pyx_v_matrix_function;
5234  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
5235  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
5236  __Pyx_TraceDeclarations
5237  __Pyx_RefNannyDeclarations
5238  int __pyx_t_1;
5239  int __pyx_t_2;
5240  PyObject *__pyx_t_3 = NULL;
5241  PyObject *__pyx_t_4 = NULL;
5242  PyObject *__pyx_t_5 = NULL;
5243  double __pyx_t_6;
5244  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5245  Py_ssize_t __pyx_t_8;
5246  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_9;
5247  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
5248  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
5249  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
5250  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_13;
5251  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_14;
5252  cLinearOperator<double> *__pyx_t_15;
5253  int __pyx_t_16;
5254  int __pyx_t_17;
5255  Py_ssize_t __pyx_t_18;
5256  Py_ssize_t __pyx_t_19;
5257  int __pyx_lineno = 0;
5258  const char *__pyx_filename = NULL;
5259  int __pyx_clineno = 0;
5260  __Pyx_RefNannySetupContext("_pyc_trace_estimator_double", 0);
5261  __Pyx_TraceCall("_pyc_trace_estimator_double", __pyx_f[0], 283, 0, __PYX_ERR(0, 283, __pyx_L1_error));
5262 
5263  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":316
5264  * cdef double[:] array_parameters
5265  *
5266  * if parameters is None: # <<<<<<<<<<<<<<
5267  * c_parameters = NULL
5268  *
5269  */
5270  __Pyx_TraceLine(316,0,__PYX_ERR(0, 316, __pyx_L1_error))
5271  __pyx_t_1 = (__pyx_v_parameters == Py_None);
5272  __pyx_t_2 = (__pyx_t_1 != 0);
5273  if (__pyx_t_2) {
5274 
5275  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":317
5276  *
5277  * if parameters is None:
5278  * c_parameters = NULL # <<<<<<<<<<<<<<
5279  *
5280  * elif numpy.isscalar(parameters):
5281  */
5282  __Pyx_TraceLine(317,0,__PYX_ERR(0, 317, __pyx_L1_error))
5283  __pyx_v_c_parameters = NULL;
5284 
5285  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":316
5286  * cdef double[:] array_parameters
5287  *
5288  * if parameters is None: # <<<<<<<<<<<<<<
5289  * c_parameters = NULL
5290  *
5291  */
5292  goto __pyx_L3;
5293  }
5294 
5295  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":319
5296  * c_parameters = NULL
5297  *
5298  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5299  * scalar_parameters = parameters
5300  * c_parameters = &scalar_parameters
5301  */
5302  __Pyx_TraceLine(319,0,__PYX_ERR(0, 319, __pyx_L1_error))
5303  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
5304  __Pyx_GOTREF(__pyx_t_4);
5305  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
5306  __Pyx_GOTREF(__pyx_t_5);
5307  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5308  __pyx_t_4 = NULL;
5309  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5310  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5311  if (likely(__pyx_t_4)) {
5312  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5313  __Pyx_INCREF(__pyx_t_4);
5314  __Pyx_INCREF(function);
5315  __Pyx_DECREF_SET(__pyx_t_5, function);
5316  }
5317  }
5318  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_parameters) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_parameters);
5319  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5320  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
5321  __Pyx_GOTREF(__pyx_t_3);
5322  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5323  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
5324  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5325  if (__pyx_t_2) {
5326 
5327  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":320
5328  *
5329  * elif numpy.isscalar(parameters):
5330  * scalar_parameters = parameters # <<<<<<<<<<<<<<
5331  * c_parameters = &scalar_parameters
5332  *
5333  */
5334  __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error))
5335  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_parameters); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L1_error)
5336  __pyx_v_scalar_parameters = __pyx_t_6;
5337 
5338  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":321
5339  * elif numpy.isscalar(parameters):
5340  * scalar_parameters = parameters
5341  * c_parameters = &scalar_parameters # <<<<<<<<<<<<<<
5342  *
5343  * else:
5344  */
5345  __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error))
5346  __pyx_v_c_parameters = (&__pyx_v_scalar_parameters);
5347 
5348  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":319
5349  * c_parameters = NULL
5350  *
5351  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5352  * scalar_parameters = parameters
5353  * c_parameters = &scalar_parameters
5354  */
5355  goto __pyx_L3;
5356  }
5357 
5358  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":324
5359  *
5360  * else:
5361  * array_parameters = parameters # <<<<<<<<<<<<<<
5362  * c_parameters = &array_parameters[0]
5363  *
5364  */
5365  __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error))
5366  /*else*/ {
5367  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_parameters, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 324, __pyx_L1_error)
5368  __pyx_v_array_parameters = __pyx_t_7;
5369  __pyx_t_7.memview = NULL;
5370  __pyx_t_7.data = NULL;
5371 
5372  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":325
5373  * else:
5374  * array_parameters = parameters
5375  * c_parameters = &array_parameters[0] # <<<<<<<<<<<<<<
5376  *
5377  * # C pointers from memoryviews
5378  */
5379  __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5380  __pyx_t_8 = 0;
5381  __pyx_v_c_parameters = (&(*((double *) ( /* dim=0 */ (__pyx_v_array_parameters.data + __pyx_t_8 * __pyx_v_array_parameters.strides[0]) ))));
5382  }
5383  __pyx_L3:;
5384 
5385  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":328
5386  *
5387  * # C pointers from memoryviews
5388  * cdef double* c_trace = &trace[0] # <<<<<<<<<<<<<<
5389  * cdef double* c_error = &error[0]
5390  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5391  */
5392  __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
5393  __pyx_t_8 = 0;
5394  __pyx_v_c_trace = (&(*((double *) ( /* dim=0 */ (__pyx_v_trace.data + __pyx_t_8 * __pyx_v_trace.strides[0]) ))));
5395 
5396  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":329
5397  * # C pointers from memoryviews
5398  * cdef double* c_trace = &trace[0]
5399  * cdef double* c_error = &error[0] # <<<<<<<<<<<<<<
5400  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5401  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5402  */
5403  __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error))
5404  __pyx_t_8 = 0;
5405  __pyx_v_c_error = (&(*((double *) ( /* dim=0 */ (__pyx_v_error.data + __pyx_t_8 * __pyx_v_error.strides[0]) ))));
5406 
5407  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":330
5408  * cdef double* c_trace = &trace[0]
5409  * cdef double* c_error = &error[0]
5410  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0] # <<<<<<<<<<<<<<
5411  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5412  * cdef IndexType* c_num_outliers = &num_outliers[0]
5413  */
5414  __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error))
5415  __pyx_t_8 = 0;
5416  __pyx_v_c_processed_samples_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) ))));
5417 
5418  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":331
5419  * cdef double* c_error = &error[0]
5420  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5421  * cdef IndexType* c_num_samples_used = &num_samples_used[0] # <<<<<<<<<<<<<<
5422  * cdef IndexType* c_num_outliers = &num_outliers[0]
5423  * cdef FlagType* c_converged = &converged[0]
5424  */
5425  __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error))
5426  __pyx_t_8 = 0;
5427  __pyx_v_c_num_samples_used = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) ))));
5428 
5429  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":332
5430  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5431  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5432  * cdef IndexType* c_num_outliers = &num_outliers[0] # <<<<<<<<<<<<<<
5433  * cdef FlagType* c_converged = &converged[0]
5434  *
5435  */
5436  __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error))
5437  __pyx_t_8 = 0;
5438  __pyx_v_c_num_outliers = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_outliers.data + __pyx_t_8 * __pyx_v_num_outliers.strides[0]) ))));
5439 
5440  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":333
5441  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5442  * cdef IndexType* c_num_outliers = &num_outliers[0]
5443  * cdef FlagType* c_converged = &converged[0] # <<<<<<<<<<<<<<
5444  *
5445  * # For samples array, instead of memoryview, allocate a 2D C array
5446  */
5447  __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error))
5448  __pyx_t_8 = 0;
5449  __pyx_v_c_converged = (&(*((int *) ( /* dim=0 */ (__pyx_v_converged.data + __pyx_t_8 * __pyx_v_converged.strides[0]) ))));
5450 
5451  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":337
5452  * # For samples array, instead of memoryview, allocate a 2D C array
5453  * cdef double** c_samples = \
5454  * <double**> malloc(sizeof(double) * max_num_samples) # <<<<<<<<<<<<<<
5455  * cdef IndexType i, j
5456  * for i in range(max_num_samples):
5457  */
5458  __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
5459  __pyx_v_c_samples = ((double **)malloc(((sizeof(double)) * __pyx_v_max_num_samples)));
5460 
5461  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":339
5462  * <double**> malloc(sizeof(double) * max_num_samples)
5463  * cdef IndexType i, j
5464  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5465  * c_samples[i] = <double*> malloc(sizeof(double*) * num_inquiries)
5466  *
5467  */
5468  __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error))
5469  __pyx_t_9 = __pyx_v_max_num_samples;
5470  __pyx_t_10 = __pyx_t_9;
5471  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5472  __pyx_v_i = __pyx_t_11;
5473 
5474  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":340
5475  * cdef IndexType i, j
5476  * for i in range(max_num_samples):
5477  * c_samples[i] = <double*> malloc(sizeof(double*) * num_inquiries) # <<<<<<<<<<<<<<
5478  *
5479  * for j in range(num_inquiries):
5480  */
5481  __Pyx_TraceLine(340,0,__PYX_ERR(0, 340, __pyx_L1_error))
5482  (__pyx_v_c_samples[__pyx_v_i]) = ((double *)malloc(((sizeof(double *)) * __pyx_v_num_inquiries)));
5483 
5484  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":342
5485  * c_samples[i] = <double*> malloc(sizeof(double*) * num_inquiries)
5486  *
5487  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5488  * c_samples[i][j] = NAN
5489  *
5490  */
5491  __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
5492  __pyx_t_12 = __pyx_v_num_inquiries;
5493  __pyx_t_13 = __pyx_t_12;
5494  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5495  __pyx_v_j = __pyx_t_14;
5496 
5497  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":343
5498  *
5499  * for j in range(num_inquiries):
5500  * c_samples[i][j] = NAN # <<<<<<<<<<<<<<
5501  *
5502  * # Get cLinearOperator
5503  */
5504  __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
5505  ((__pyx_v_c_samples[__pyx_v_i])[__pyx_v_j]) = NAN;
5506  }
5507  }
5508 
5509  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":346
5510  *
5511  * # Get cLinearOperator
5512  * cdef cLinearOperator[double]* Aop_double = Aop.get_linear_operator_double() # <<<<<<<<<<<<<<
5513  *
5514  * cdef Function* matrix_function = py_matrix_function.get_function()
5515  */
5516  __Pyx_TraceLine(346,0,__PYX_ERR(0, 346, __pyx_L1_error))
5517  __pyx_t_15 = ((struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_Aop->__pyx_vtab)->get_linear_operator_double(__pyx_v_Aop); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L1_error)
5518  __pyx_v_Aop_double = __pyx_t_15;
5519 
5520  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":348
5521  * cdef cLinearOperator[double]* Aop_double = Aop.get_linear_operator_double()
5522  *
5523  * cdef Function* matrix_function = py_matrix_function.get_function() # <<<<<<<<<<<<<<
5524  *
5525  * # Call templated c++ module
5526  */
5527  __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error))
5528  __pyx_v_matrix_function = ((struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *)__pyx_v_py_matrix_function->__pyx_vtab)->get_function(__pyx_v_py_matrix_function);
5529 
5530  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":352
5531  * # Call templated c++ module
5532  * cdef FlagType all_converged = \
5533  * cTraceEstimator[double].c_trace_estimator( # <<<<<<<<<<<<<<
5534  * Aop_double,
5535  * c_parameters,
5536  */
5537  __Pyx_TraceLine(352,0,__PYX_ERR(0, 352, __pyx_L1_error))
5538  __pyx_v_all_converged = cTraceEstimator<double> ::c_trace_estimator(__pyx_v_Aop_double, __pyx_v_c_parameters, __pyx_v_num_inquiries, __pyx_v_matrix_function, __pyx_v_exponent, ((__pyx_t_5imate_12_definitions_5types_FlagType const )__pyx_v_symmetric), __pyx_v_reorthogonalize, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_c_trace, __pyx_v_c_error, __pyx_v_c_samples, __pyx_v_c_processed_samples_indices, __pyx_v_c_num_samples_used, __pyx_v_c_num_outliers, __pyx_v_c_converged, __pyx_v_alg_wall_time);
5539 
5540  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":380
5541  * # Write the processed samples to samples to a numpy array. The unprocessed
5542  * # elements of samples array is nan.
5543  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5544  * for i in range(num_samples_used[j]):
5545  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5546  */
5547  __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
5548  __pyx_t_9 = __pyx_v_num_inquiries;
5549  __pyx_t_10 = __pyx_t_9;
5550  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5551  __pyx_v_j = __pyx_t_11;
5552 
5553  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":381
5554  * # elements of samples array is nan.
5555  * for j in range(num_inquiries):
5556  * for i in range(num_samples_used[j]): # <<<<<<<<<<<<<<
5557  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5558  * # for i in range(max_num_samples):
5559  */
5560  __Pyx_TraceLine(381,0,__PYX_ERR(0, 381, __pyx_L1_error))
5561  __pyx_t_8 = __pyx_v_j;
5562  __pyx_t_16 = (*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) )));
5563  __pyx_t_17 = __pyx_t_16;
5564  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_17; __pyx_t_12+=1) {
5565  __pyx_v_i = __pyx_t_12;
5566 
5567  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":382
5568  * for j in range(num_inquiries):
5569  * for i in range(num_samples_used[j]):
5570  * samples[i, j] = c_samples[processed_samples_indices[i]][j] # <<<<<<<<<<<<<<
5571  * # for i in range(max_num_samples):
5572  * # samples[i, j] = c_samples[i][j]
5573  */
5574  __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error))
5575  __pyx_t_8 = __pyx_v_i;
5576  __pyx_t_18 = __pyx_v_i;
5577  __pyx_t_19 = __pyx_v_j;
5578  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )) + __pyx_t_19)) )) = ((__pyx_v_c_samples[(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) )))])[__pyx_v_j]);
5579  }
5580  }
5581 
5582  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":387
5583  *
5584  * # Deallocate dynamic memory
5585  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5586  * free(c_samples[i])
5587  * free(c_samples)
5588  */
5589  __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error))
5590  __pyx_t_9 = __pyx_v_max_num_samples;
5591  __pyx_t_10 = __pyx_t_9;
5592  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5593  __pyx_v_i = __pyx_t_11;
5594 
5595  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":388
5596  * # Deallocate dynamic memory
5597  * for i in range(max_num_samples):
5598  * free(c_samples[i]) # <<<<<<<<<<<<<<
5599  * free(c_samples)
5600  *
5601  */
5602  __Pyx_TraceLine(388,0,__PYX_ERR(0, 388, __pyx_L1_error))
5603  free((__pyx_v_c_samples[__pyx_v_i]));
5604  }
5605 
5606  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":389
5607  * for i in range(max_num_samples):
5608  * free(c_samples[i])
5609  * free(c_samples) # <<<<<<<<<<<<<<
5610  *
5611  * return all_converged
5612  */
5613  __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
5614  free(__pyx_v_c_samples);
5615 
5616  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":391
5617  * free(c_samples)
5618  *
5619  * return all_converged # <<<<<<<<<<<<<<
5620  *
5621  *
5622  */
5623  __Pyx_TraceLine(391,0,__PYX_ERR(0, 391, __pyx_L1_error))
5624  __pyx_r = __pyx_v_all_converged;
5625  goto __pyx_L0;
5626 
5627  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":283
5628  * # ==========================
5629  *
5630  * cdef FlagType _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
5631  * pycLinearOperator Aop,
5632  * parameters,
5633  */
5634 
5635  /* function exit code */
5636  __pyx_L1_error:;
5637  __Pyx_XDECREF(__pyx_t_3);
5638  __Pyx_XDECREF(__pyx_t_4);
5639  __Pyx_XDECREF(__pyx_t_5);
5640  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5641  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator._pyc_trace_estimator_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5642  __pyx_r = -1;
5643  __pyx_L0:;
5644  __PYX_XDEC_MEMVIEW(&__pyx_v_array_parameters, 1);
5645  __Pyx_TraceReturn(Py_None, 0);
5646  __Pyx_RefNannyFinishContext();
5647  return __pyx_r;
5648 }
5649 
5650 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":398
5651  * # ===============================
5652  *
5653  * cdef FlagType _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
5654  * pycLinearOperator Aop,
5655  * parameters,
5656  */
5657 
5658 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_long_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, long double const __pyx_v_exponent, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_symmetric, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_reorthogonalize, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_lanczos_degree, long double const __pyx_v_lanczos_tol, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_min_num_samples, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_max_num_samples, long double const __pyx_v_error_atol, long double const __pyx_v_error_rtol, long double const __pyx_v_confidence_level, long double const __pyx_v_outlier_significance_level, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_threads, __Pyx_memviewslice __pyx_v_trace, __Pyx_memviewslice __pyx_v_error, __Pyx_memviewslice __pyx_v_samples, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_processed_samples_indices, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_samples_used, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_outliers, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_v_converged, float &__pyx_v_alg_wall_time) {
5659  long double *__pyx_v_c_parameters;
5660  long double __pyx_v_scalar_parameters;
5661  __Pyx_memviewslice __pyx_v_array_parameters = { 0, 0, { 0 }, { 0 }, { 0 } };
5662  long double *__pyx_v_c_trace;
5663  long double *__pyx_v_c_error;
5664  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_processed_samples_indices;
5665  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_samples_used;
5666  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_outliers;
5667  __pyx_t_5imate_12_definitions_5types_FlagType *__pyx_v_c_converged;
5668  long double **__pyx_v_c_samples;
5669  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_i;
5670  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_j;
5671  cLinearOperator<long double> *__pyx_v_Aop_long_double;
5672  Function *__pyx_v_matrix_function;
5673  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
5674  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
5675  __Pyx_TraceDeclarations
5676  __Pyx_RefNannyDeclarations
5677  int __pyx_t_1;
5678  int __pyx_t_2;
5679  PyObject *__pyx_t_3 = NULL;
5680  PyObject *__pyx_t_4 = NULL;
5681  PyObject *__pyx_t_5 = NULL;
5682  long double __pyx_t_6;
5683  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5684  Py_ssize_t __pyx_t_8;
5685  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_9;
5686  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
5687  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
5688  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
5689  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_13;
5690  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_14;
5691  cLinearOperator<long double> *__pyx_t_15;
5692  int __pyx_t_16;
5693  int __pyx_t_17;
5694  Py_ssize_t __pyx_t_18;
5695  Py_ssize_t __pyx_t_19;
5696  int __pyx_lineno = 0;
5697  const char *__pyx_filename = NULL;
5698  int __pyx_clineno = 0;
5699  __Pyx_RefNannySetupContext("_pyc_trace_estimator_long_double", 0);
5700  __Pyx_TraceCall("_pyc_trace_estimator_long_double", __pyx_f[0], 398, 0, __PYX_ERR(0, 398, __pyx_L1_error));
5701 
5702  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":431
5703  * cdef long double[:] array_parameters
5704  *
5705  * if parameters is None: # <<<<<<<<<<<<<<
5706  * c_parameters = NULL
5707  *
5708  */
5709  __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
5710  __pyx_t_1 = (__pyx_v_parameters == Py_None);
5711  __pyx_t_2 = (__pyx_t_1 != 0);
5712  if (__pyx_t_2) {
5713 
5714  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":432
5715  *
5716  * if parameters is None:
5717  * c_parameters = NULL # <<<<<<<<<<<<<<
5718  *
5719  * elif numpy.isscalar(parameters):
5720  */
5721  __Pyx_TraceLine(432,0,__PYX_ERR(0, 432, __pyx_L1_error))
5722  __pyx_v_c_parameters = NULL;
5723 
5724  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":431
5725  * cdef long double[:] array_parameters
5726  *
5727  * if parameters is None: # <<<<<<<<<<<<<<
5728  * c_parameters = NULL
5729  *
5730  */
5731  goto __pyx_L3;
5732  }
5733 
5734  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":434
5735  * c_parameters = NULL
5736  *
5737  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5738  * scalar_parameters = parameters
5739  * c_parameters = &scalar_parameters
5740  */
5741  __Pyx_TraceLine(434,0,__PYX_ERR(0, 434, __pyx_L1_error))
5742  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
5743  __Pyx_GOTREF(__pyx_t_4);
5744  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
5745  __Pyx_GOTREF(__pyx_t_5);
5746  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5747  __pyx_t_4 = NULL;
5748  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5749  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5750  if (likely(__pyx_t_4)) {
5751  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5752  __Pyx_INCREF(__pyx_t_4);
5753  __Pyx_INCREF(function);
5754  __Pyx_DECREF_SET(__pyx_t_5, function);
5755  }
5756  }
5757  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_parameters) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_parameters);
5758  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5759  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
5760  __Pyx_GOTREF(__pyx_t_3);
5761  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5762  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 434, __pyx_L1_error)
5763  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5764  if (__pyx_t_2) {
5765 
5766  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":435
5767  *
5768  * elif numpy.isscalar(parameters):
5769  * scalar_parameters = parameters # <<<<<<<<<<<<<<
5770  * c_parameters = &scalar_parameters
5771  *
5772  */
5773  __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error))
5774  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_parameters); if (unlikely((__pyx_t_6 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error)
5775  __pyx_v_scalar_parameters = __pyx_t_6;
5776 
5777  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":436
5778  * elif numpy.isscalar(parameters):
5779  * scalar_parameters = parameters
5780  * c_parameters = &scalar_parameters # <<<<<<<<<<<<<<
5781  *
5782  * else:
5783  */
5784  __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
5785  __pyx_v_c_parameters = (&__pyx_v_scalar_parameters);
5786 
5787  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":434
5788  * c_parameters = NULL
5789  *
5790  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5791  * scalar_parameters = parameters
5792  * c_parameters = &scalar_parameters
5793  */
5794  goto __pyx_L3;
5795  }
5796 
5797  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":439
5798  *
5799  * else:
5800  * array_parameters = parameters # <<<<<<<<<<<<<<
5801  * c_parameters = &array_parameters[0]
5802  *
5803  */
5804  __Pyx_TraceLine(439,0,__PYX_ERR(0, 439, __pyx_L1_error))
5805  /*else*/ {
5806  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_parameters, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 439, __pyx_L1_error)
5807  __pyx_v_array_parameters = __pyx_t_7;
5808  __pyx_t_7.memview = NULL;
5809  __pyx_t_7.data = NULL;
5810 
5811  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":440
5812  * else:
5813  * array_parameters = parameters
5814  * c_parameters = &array_parameters[0] # <<<<<<<<<<<<<<
5815  *
5816  * # C pointers from memoryviews
5817  */
5818  __Pyx_TraceLine(440,0,__PYX_ERR(0, 440, __pyx_L1_error))
5819  __pyx_t_8 = 0;
5820  __pyx_v_c_parameters = (&(*((long double *) ( /* dim=0 */ (__pyx_v_array_parameters.data + __pyx_t_8 * __pyx_v_array_parameters.strides[0]) ))));
5821  }
5822  __pyx_L3:;
5823 
5824  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":443
5825  *
5826  * # C pointers from memoryviews
5827  * cdef long double* c_trace = &trace[0] # <<<<<<<<<<<<<<
5828  * cdef long double* c_error = &error[0]
5829  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5830  */
5831  __Pyx_TraceLine(443,0,__PYX_ERR(0, 443, __pyx_L1_error))
5832  __pyx_t_8 = 0;
5833  __pyx_v_c_trace = (&(*((long double *) ( /* dim=0 */ (__pyx_v_trace.data + __pyx_t_8 * __pyx_v_trace.strides[0]) ))));
5834 
5835  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":444
5836  * # C pointers from memoryviews
5837  * cdef long double* c_trace = &trace[0]
5838  * cdef long double* c_error = &error[0] # <<<<<<<<<<<<<<
5839  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5840  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5841  */
5842  __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error))
5843  __pyx_t_8 = 0;
5844  __pyx_v_c_error = (&(*((long double *) ( /* dim=0 */ (__pyx_v_error.data + __pyx_t_8 * __pyx_v_error.strides[0]) ))));
5845 
5846  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":445
5847  * cdef long double* c_trace = &trace[0]
5848  * cdef long double* c_error = &error[0]
5849  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0] # <<<<<<<<<<<<<<
5850  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5851  * cdef IndexType* c_num_outliers = &num_outliers[0]
5852  */
5853  __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error))
5854  __pyx_t_8 = 0;
5855  __pyx_v_c_processed_samples_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) ))));
5856 
5857  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":446
5858  * cdef long double* c_error = &error[0]
5859  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5860  * cdef IndexType* c_num_samples_used = &num_samples_used[0] # <<<<<<<<<<<<<<
5861  * cdef IndexType* c_num_outliers = &num_outliers[0]
5862  * cdef FlagType* c_converged = &converged[0]
5863  */
5864  __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5865  __pyx_t_8 = 0;
5866  __pyx_v_c_num_samples_used = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) ))));
5867 
5868  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":447
5869  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5870  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5871  * cdef IndexType* c_num_outliers = &num_outliers[0] # <<<<<<<<<<<<<<
5872  * cdef FlagType* c_converged = &converged[0]
5873  *
5874  */
5875  __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
5876  __pyx_t_8 = 0;
5877  __pyx_v_c_num_outliers = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_outliers.data + __pyx_t_8 * __pyx_v_num_outliers.strides[0]) ))));
5878 
5879  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":448
5880  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5881  * cdef IndexType* c_num_outliers = &num_outliers[0]
5882  * cdef FlagType* c_converged = &converged[0] # <<<<<<<<<<<<<<
5883  *
5884  * # For samples array, instead of memoryview, allocate a 2D C array
5885  */
5886  __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error))
5887  __pyx_t_8 = 0;
5888  __pyx_v_c_converged = (&(*((int *) ( /* dim=0 */ (__pyx_v_converged.data + __pyx_t_8 * __pyx_v_converged.strides[0]) ))));
5889 
5890  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":452
5891  * # For samples array, instead of memoryview, allocate a 2D C array
5892  * cdef long double** c_samples = \
5893  * <long double**> malloc(sizeof(long double*) * max_num_samples) # <<<<<<<<<<<<<<
5894  * cdef IndexType i, j
5895  * for i in range(max_num_samples):
5896  */
5897  __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
5898  __pyx_v_c_samples = ((long double **)malloc(((sizeof(long double *)) * __pyx_v_max_num_samples)));
5899 
5900  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":454
5901  * <long double**> malloc(sizeof(long double*) * max_num_samples)
5902  * cdef IndexType i, j
5903  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5904  * c_samples[i] = \
5905  * <long double*> malloc(sizeof(long double) * num_inquiries)
5906  */
5907  __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5908  __pyx_t_9 = __pyx_v_max_num_samples;
5909  __pyx_t_10 = __pyx_t_9;
5910  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5911  __pyx_v_i = __pyx_t_11;
5912 
5913  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":455
5914  * cdef IndexType i, j
5915  * for i in range(max_num_samples):
5916  * c_samples[i] = \ # <<<<<<<<<<<<<<
5917  * <long double*> malloc(sizeof(long double) * num_inquiries)
5918  *
5919  */
5920  __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error))
5921  (__pyx_v_c_samples[__pyx_v_i]) = ((long double *)malloc(((sizeof(long double)) * __pyx_v_num_inquiries)));
5922 
5923  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":458
5924  * <long double*> malloc(sizeof(long double) * num_inquiries)
5925  *
5926  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5927  * c_samples[i][j] = NAN
5928  *
5929  */
5930  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5931  __pyx_t_12 = __pyx_v_num_inquiries;
5932  __pyx_t_13 = __pyx_t_12;
5933  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5934  __pyx_v_j = __pyx_t_14;
5935 
5936  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":459
5937  *
5938  * for j in range(num_inquiries):
5939  * c_samples[i][j] = NAN # <<<<<<<<<<<<<<
5940  *
5941  * # Get cLinearOperator
5942  */
5943  __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error))
5944  ((__pyx_v_c_samples[__pyx_v_i])[__pyx_v_j]) = NAN;
5945  }
5946  }
5947 
5948  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":463
5949  * # Get cLinearOperator
5950  * cdef cLinearOperator[long double]* Aop_long_double = \
5951  * Aop.get_linear_operator_long_double() # <<<<<<<<<<<<<<
5952  *
5953  * cdef Function* matrix_function = py_matrix_function.get_function()
5954  */
5955  __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error))
5956  __pyx_t_15 = ((struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_Aop->__pyx_vtab)->get_linear_operator_long_double(__pyx_v_Aop); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
5957  __pyx_v_Aop_long_double = __pyx_t_15;
5958 
5959  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":465
5960  * Aop.get_linear_operator_long_double()
5961  *
5962  * cdef Function* matrix_function = py_matrix_function.get_function() # <<<<<<<<<<<<<<
5963  *
5964  * # Call templated c++ module
5965  */
5966  __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error))
5967  __pyx_v_matrix_function = ((struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *)__pyx_v_py_matrix_function->__pyx_vtab)->get_function(__pyx_v_py_matrix_function);
5968 
5969  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":469
5970  * # Call templated c++ module
5971  * cdef FlagType all_converged = \
5972  * cTraceEstimator[long_double].c_trace_estimator( # <<<<<<<<<<<<<<
5973  * Aop_long_double,
5974  * c_parameters,
5975  */
5976  __Pyx_TraceLine(469,0,__PYX_ERR(0, 469, __pyx_L1_error))
5977  __pyx_v_all_converged = cTraceEstimator<__pyx_t_5imate_18_c_trace_estimator_20py_c_trace_estimator_long_double> ::c_trace_estimator(__pyx_v_Aop_long_double, __pyx_v_c_parameters, __pyx_v_num_inquiries, __pyx_v_matrix_function, __pyx_v_exponent, ((__pyx_t_5imate_12_definitions_5types_FlagType const )__pyx_v_symmetric), __pyx_v_reorthogonalize, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_c_trace, __pyx_v_c_error, __pyx_v_c_samples, __pyx_v_c_processed_samples_indices, __pyx_v_c_num_samples_used, __pyx_v_c_num_outliers, __pyx_v_c_converged, __pyx_v_alg_wall_time);
5978 
5979  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":497
5980  * # Write the processed samples to samples to a numpy array. The unprocessed
5981  * # elements of samples array is nan.
5982  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5983  * for i in range(num_samples_used[j]):
5984  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5985  */
5986  __Pyx_TraceLine(497,0,__PYX_ERR(0, 497, __pyx_L1_error))
5987  __pyx_t_9 = __pyx_v_num_inquiries;
5988  __pyx_t_10 = __pyx_t_9;
5989  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5990  __pyx_v_j = __pyx_t_11;
5991 
5992  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":498
5993  * # elements of samples array is nan.
5994  * for j in range(num_inquiries):
5995  * for i in range(num_samples_used[j]): # <<<<<<<<<<<<<<
5996  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5997  * # for i in range(max_num_samples):
5998  */
5999  __Pyx_TraceLine(498,0,__PYX_ERR(0, 498, __pyx_L1_error))
6000  __pyx_t_8 = __pyx_v_j;
6001  __pyx_t_16 = (*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) )));
6002  __pyx_t_17 = __pyx_t_16;
6003  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_17; __pyx_t_12+=1) {
6004  __pyx_v_i = __pyx_t_12;
6005 
6006  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":499
6007  * for j in range(num_inquiries):
6008  * for i in range(num_samples_used[j]):
6009  * samples[i, j] = c_samples[processed_samples_indices[i]][j] # <<<<<<<<<<<<<<
6010  * # for i in range(max_num_samples):
6011  * # samples[i, j] = c_samples[i][j]
6012  */
6013  __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
6014  __pyx_t_8 = __pyx_v_i;
6015  __pyx_t_18 = __pyx_v_i;
6016  __pyx_t_19 = __pyx_v_j;
6017  *((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )) + __pyx_t_19)) )) = ((__pyx_v_c_samples[(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) )))])[__pyx_v_j]);
6018  }
6019  }
6020 
6021  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":504
6022  *
6023  * # Deallocate dynamic memory
6024  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
6025  * free(c_samples[i])
6026  * free(c_samples)
6027  */
6028  __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
6029  __pyx_t_9 = __pyx_v_max_num_samples;
6030  __pyx_t_10 = __pyx_t_9;
6031  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
6032  __pyx_v_i = __pyx_t_11;
6033 
6034  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":505
6035  * # Deallocate dynamic memory
6036  * for i in range(max_num_samples):
6037  * free(c_samples[i]) # <<<<<<<<<<<<<<
6038  * free(c_samples)
6039  *
6040  */
6041  __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error))
6042  free((__pyx_v_c_samples[__pyx_v_i]));
6043  }
6044 
6045  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":506
6046  * for i in range(max_num_samples):
6047  * free(c_samples[i])
6048  * free(c_samples) # <<<<<<<<<<<<<<
6049  *
6050  * return all_converged
6051  */
6052  __Pyx_TraceLine(506,0,__PYX_ERR(0, 506, __pyx_L1_error))
6053  free(__pyx_v_c_samples);
6054 
6055  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":508
6056  * free(c_samples)
6057  *
6058  * return all_converged # <<<<<<<<<<<<<<
6059  */
6060  __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
6061  __pyx_r = __pyx_v_all_converged;
6062  goto __pyx_L0;
6063 
6064  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":398
6065  * # ===============================
6066  *
6067  * cdef FlagType _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
6068  * pycLinearOperator Aop,
6069  * parameters,
6070  */
6071 
6072  /* function exit code */
6073  __pyx_L1_error:;
6074  __Pyx_XDECREF(__pyx_t_3);
6075  __Pyx_XDECREF(__pyx_t_4);
6076  __Pyx_XDECREF(__pyx_t_5);
6077  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6078  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator._pyc_trace_estimator_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6079  __pyx_r = -1;
6080  __pyx_L0:;
6081  __PYX_XDEC_MEMVIEW(&__pyx_v_array_parameters, 1);
6082  __Pyx_TraceReturn(Py_None, 0);
6083  __Pyx_RefNannyFinishContext();
6084  return __pyx_r;
6085 }
6086 
6087 /* "View.MemoryView":123
6088  * cdef bint dtype_is_object
6089  *
6090  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6091  * mode="c", bint allocate_buffer=True):
6092  *
6093  */
6094 
6095 /* Python wrapper */
6096 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6097 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6098  PyObject *__pyx_v_shape = 0;
6099  Py_ssize_t __pyx_v_itemsize;
6100  PyObject *__pyx_v_format = 0;
6101  PyObject *__pyx_v_mode = 0;
6102  int __pyx_v_allocate_buffer;
6103  int __pyx_lineno = 0;
6104  const char *__pyx_filename = NULL;
6105  int __pyx_clineno = 0;
6106  int __pyx_r;
6107  __Pyx_RefNannyDeclarations
6108  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
6109  {
6110  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6111  PyObject* values[5] = {0,0,0,0,0};
6112  values[3] = ((PyObject *)__pyx_n_s_c);
6113  if (unlikely(__pyx_kwds)) {
6114  Py_ssize_t kw_args;
6115  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6116  switch (pos_args) {
6117  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6118  CYTHON_FALLTHROUGH;
6119  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6120  CYTHON_FALLTHROUGH;
6121  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6122  CYTHON_FALLTHROUGH;
6123  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6124  CYTHON_FALLTHROUGH;
6125  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6126  CYTHON_FALLTHROUGH;
6127  case 0: break;
6128  default: goto __pyx_L5_argtuple_error;
6129  }
6130  kw_args = PyDict_Size(__pyx_kwds);
6131  switch (pos_args) {
6132  case 0:
6133  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6134  else goto __pyx_L5_argtuple_error;
6135  CYTHON_FALLTHROUGH;
6136  case 1:
6137  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6138  else {
6139  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 123, __pyx_L3_error)
6140  }
6141  CYTHON_FALLTHROUGH;
6142  case 2:
6143  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6144  else {
6145  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 123, __pyx_L3_error)
6146  }
6147  CYTHON_FALLTHROUGH;
6148  case 3:
6149  if (kw_args > 0) {
6150  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6151  if (value) { values[3] = value; kw_args--; }
6152  }
6153  CYTHON_FALLTHROUGH;
6154  case 4:
6155  if (kw_args > 0) {
6156  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6157  if (value) { values[4] = value; kw_args--; }
6158  }
6159  }
6160  if (unlikely(kw_args > 0)) {
6161  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 123, __pyx_L3_error)
6162  }
6163  } else {
6164  switch (PyTuple_GET_SIZE(__pyx_args)) {
6165  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6166  CYTHON_FALLTHROUGH;
6167  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6168  CYTHON_FALLTHROUGH;
6169  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6170  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6171  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6172  break;
6173  default: goto __pyx_L5_argtuple_error;
6174  }
6175  }
6176  __pyx_v_shape = ((PyObject*)values[0]);
6177  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
6178  __pyx_v_format = values[2];
6179  __pyx_v_mode = values[3];
6180  if (values[4]) {
6181  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 124, __pyx_L3_error)
6182  } else {
6183 
6184  /* "View.MemoryView":124
6185  *
6186  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
6187  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
6188  *
6189  * cdef int idx
6190  */
6191  __pyx_v_allocate_buffer = ((int)1);
6192  }
6193  }
6194  goto __pyx_L4_argument_unpacking_done;
6195  __pyx_L5_argtuple_error:;
6196  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 123, __pyx_L3_error)
6197  __pyx_L3_error:;
6198  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6199  __Pyx_RefNannyFinishContext();
6200  return -1;
6201  __pyx_L4_argument_unpacking_done:;
6202  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 123, __pyx_L1_error)
6203  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6204  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 123, __pyx_L1_error)
6205  }
6206  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6207 
6208  /* "View.MemoryView":123
6209  * cdef bint dtype_is_object
6210  *
6211  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6212  * mode="c", bint allocate_buffer=True):
6213  *
6214  */
6215 
6216  /* function exit code */
6217  goto __pyx_L0;
6218  __pyx_L1_error:;
6219  __pyx_r = -1;
6220  __pyx_L0:;
6221  __Pyx_RefNannyFinishContext();
6222  return __pyx_r;
6223 }
6224 
6225 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
6226  int __pyx_v_idx;
6227  Py_ssize_t __pyx_v_i;
6228  Py_ssize_t __pyx_v_dim;
6229  PyObject **__pyx_v_p;
6230  char __pyx_v_order;
6231  int __pyx_r;
6232  __Pyx_TraceDeclarations
6233  __Pyx_RefNannyDeclarations
6234  Py_ssize_t __pyx_t_1;
6235  int __pyx_t_2;
6236  PyObject *__pyx_t_3 = NULL;
6237  int __pyx_t_4;
6238  PyObject *__pyx_t_5 = NULL;
6239  PyObject *__pyx_t_6 = NULL;
6240  char *__pyx_t_7;
6241  int __pyx_t_8;
6242  Py_ssize_t __pyx_t_9;
6243  PyObject *__pyx_t_10 = NULL;
6244  Py_ssize_t __pyx_t_11;
6245  int __pyx_lineno = 0;
6246  const char *__pyx_filename = NULL;
6247  int __pyx_clineno = 0;
6248  __Pyx_RefNannySetupContext("__cinit__", 0);
6249  __Pyx_TraceCall("__cinit__", __pyx_f[2], 123, 0, __PYX_ERR(2, 123, __pyx_L1_error));
6250  __Pyx_INCREF(__pyx_v_format);
6251 
6252  /* "View.MemoryView":130
6253  * cdef PyObject **p
6254  *
6255  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
6256  * self.itemsize = itemsize
6257  *
6258  */
6259  __Pyx_TraceLine(130,0,__PYX_ERR(2, 130, __pyx_L1_error))
6260  if (unlikely(__pyx_v_shape == Py_None)) {
6261  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6262  __PYX_ERR(2, 130, __pyx_L1_error)
6263  }
6264  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 130, __pyx_L1_error)
6265  __pyx_v_self->ndim = ((int)__pyx_t_1);
6266 
6267  /* "View.MemoryView":131
6268  *
6269  * self.ndim = <int> len(shape)
6270  * self.itemsize = itemsize # <<<<<<<<<<<<<<
6271  *
6272  * if not self.ndim:
6273  */
6274  __Pyx_TraceLine(131,0,__PYX_ERR(2, 131, __pyx_L1_error))
6275  __pyx_v_self->itemsize = __pyx_v_itemsize;
6276 
6277  /* "View.MemoryView":133
6278  * self.itemsize = itemsize
6279  *
6280  * if not self.ndim: # <<<<<<<<<<<<<<
6281  * raise ValueError("Empty shape tuple for cython.array")
6282  *
6283  */
6284  __Pyx_TraceLine(133,0,__PYX_ERR(2, 133, __pyx_L1_error))
6285  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6286  if (unlikely(__pyx_t_2)) {
6287 
6288  /* "View.MemoryView":134
6289  *
6290  * if not self.ndim:
6291  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
6292  *
6293  * if itemsize <= 0:
6294  */
6295  __Pyx_TraceLine(134,0,__PYX_ERR(2, 134, __pyx_L1_error))
6296  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error)
6297  __Pyx_GOTREF(__pyx_t_3);
6298  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6299  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6300  __PYX_ERR(2, 134, __pyx_L1_error)
6301 
6302  /* "View.MemoryView":133
6303  * self.itemsize = itemsize
6304  *
6305  * if not self.ndim: # <<<<<<<<<<<<<<
6306  * raise ValueError("Empty shape tuple for cython.array")
6307  *
6308  */
6309  }
6310 
6311  /* "View.MemoryView":136
6312  * raise ValueError("Empty shape tuple for cython.array")
6313  *
6314  * if itemsize <= 0: # <<<<<<<<<<<<<<
6315  * raise ValueError("itemsize <= 0 for cython.array")
6316  *
6317  */
6318  __Pyx_TraceLine(136,0,__PYX_ERR(2, 136, __pyx_L1_error))
6319  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6320  if (unlikely(__pyx_t_2)) {
6321 
6322  /* "View.MemoryView":137
6323  *
6324  * if itemsize <= 0:
6325  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
6326  *
6327  * if not isinstance(format, bytes):
6328  */
6329  __Pyx_TraceLine(137,0,__PYX_ERR(2, 137, __pyx_L1_error))
6330  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error)
6331  __Pyx_GOTREF(__pyx_t_3);
6332  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6333  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6334  __PYX_ERR(2, 137, __pyx_L1_error)
6335 
6336  /* "View.MemoryView":136
6337  * raise ValueError("Empty shape tuple for cython.array")
6338  *
6339  * if itemsize <= 0: # <<<<<<<<<<<<<<
6340  * raise ValueError("itemsize <= 0 for cython.array")
6341  *
6342  */
6343  }
6344 
6345  /* "View.MemoryView":139
6346  * raise ValueError("itemsize <= 0 for cython.array")
6347  *
6348  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6349  * format = format.encode('ASCII')
6350  * self._format = format # keep a reference to the byte string
6351  */
6352  __Pyx_TraceLine(139,0,__PYX_ERR(2, 139, __pyx_L1_error))
6353  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6354  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6355  if (__pyx_t_4) {
6356 
6357  /* "View.MemoryView":140
6358  *
6359  * if not isinstance(format, bytes):
6360  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
6361  * self._format = format # keep a reference to the byte string
6362  * self.format = self._format
6363  */
6364  __Pyx_TraceLine(140,0,__PYX_ERR(2, 140, __pyx_L1_error))
6365  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 140, __pyx_L1_error)
6366  __Pyx_GOTREF(__pyx_t_5);
6367  __pyx_t_6 = NULL;
6368  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6369  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6370  if (likely(__pyx_t_6)) {
6371  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6372  __Pyx_INCREF(__pyx_t_6);
6373  __Pyx_INCREF(function);
6374  __Pyx_DECREF_SET(__pyx_t_5, function);
6375  }
6376  }
6377  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
6378  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6379  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 140, __pyx_L1_error)
6380  __Pyx_GOTREF(__pyx_t_3);
6381  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6382  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6383  __pyx_t_3 = 0;
6384 
6385  /* "View.MemoryView":139
6386  * raise ValueError("itemsize <= 0 for cython.array")
6387  *
6388  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6389  * format = format.encode('ASCII')
6390  * self._format = format # keep a reference to the byte string
6391  */
6392  }
6393 
6394  /* "View.MemoryView":141
6395  * if not isinstance(format, bytes):
6396  * format = format.encode('ASCII')
6397  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
6398  * self.format = self._format
6399  *
6400  */
6401  __Pyx_TraceLine(141,0,__PYX_ERR(2, 141, __pyx_L1_error))
6402  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 141, __pyx_L1_error)
6403  __pyx_t_3 = __pyx_v_format;
6404  __Pyx_INCREF(__pyx_t_3);
6405  __Pyx_GIVEREF(__pyx_t_3);
6406  __Pyx_GOTREF(__pyx_v_self->_format);
6407  __Pyx_DECREF(__pyx_v_self->_format);
6408  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6409  __pyx_t_3 = 0;
6410 
6411  /* "View.MemoryView":142
6412  * format = format.encode('ASCII')
6413  * self._format = format # keep a reference to the byte string
6414  * self.format = self._format # <<<<<<<<<<<<<<
6415  *
6416  *
6417  */
6418  __Pyx_TraceLine(142,0,__PYX_ERR(2, 142, __pyx_L1_error))
6419  if (unlikely(__pyx_v_self->_format == Py_None)) {
6420  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6421  __PYX_ERR(2, 142, __pyx_L1_error)
6422  }
6423  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 142, __pyx_L1_error)
6424  __pyx_v_self->format = __pyx_t_7;
6425 
6426  /* "View.MemoryView":145
6427  *
6428  *
6429  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
6430  * self._strides = self._shape + self.ndim
6431  *
6432  */
6433  __Pyx_TraceLine(145,0,__PYX_ERR(2, 145, __pyx_L1_error))
6434  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6435 
6436  /* "View.MemoryView":146
6437  *
6438  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
6439  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
6440  *
6441  * if not self._shape:
6442  */
6443  __Pyx_TraceLine(146,0,__PYX_ERR(2, 146, __pyx_L1_error))
6444  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6445 
6446  /* "View.MemoryView":148
6447  * self._strides = self._shape + self.ndim
6448  *
6449  * if not self._shape: # <<<<<<<<<<<<<<
6450  * raise MemoryError("unable to allocate shape and strides.")
6451  *
6452  */
6453  __Pyx_TraceLine(148,0,__PYX_ERR(2, 148, __pyx_L1_error))
6454  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6455  if (unlikely(__pyx_t_4)) {
6456 
6457  /* "View.MemoryView":149
6458  *
6459  * if not self._shape:
6460  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
6461  *
6462  *
6463  */
6464  __Pyx_TraceLine(149,0,__PYX_ERR(2, 149, __pyx_L1_error))
6465  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error)
6466  __Pyx_GOTREF(__pyx_t_3);
6467  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6468  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6469  __PYX_ERR(2, 149, __pyx_L1_error)
6470 
6471  /* "View.MemoryView":148
6472  * self._strides = self._shape + self.ndim
6473  *
6474  * if not self._shape: # <<<<<<<<<<<<<<
6475  * raise MemoryError("unable to allocate shape and strides.")
6476  *
6477  */
6478  }
6479 
6480  /* "View.MemoryView":152
6481  *
6482  *
6483  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6484  * if dim <= 0:
6485  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6486  */
6487  __Pyx_TraceLine(152,0,__PYX_ERR(2, 152, __pyx_L1_error))
6488  __pyx_t_8 = 0;
6489  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6490  for (;;) {
6491  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
6492  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6493  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 152, __pyx_L1_error)
6494  #else
6495  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 152, __pyx_L1_error)
6496  __Pyx_GOTREF(__pyx_t_5);
6497  #endif
6498  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 152, __pyx_L1_error)
6499  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6500  __pyx_v_dim = __pyx_t_9;
6501  __pyx_v_idx = __pyx_t_8;
6502  __pyx_t_8 = (__pyx_t_8 + 1);
6503 
6504  /* "View.MemoryView":153
6505  *
6506  * for idx, dim in enumerate(shape):
6507  * if dim <= 0: # <<<<<<<<<<<<<<
6508  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6509  * self._shape[idx] = dim
6510  */
6511  __Pyx_TraceLine(153,0,__PYX_ERR(2, 153, __pyx_L1_error))
6512  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6513  if (unlikely(__pyx_t_4)) {
6514 
6515  /* "View.MemoryView":154
6516  * for idx, dim in enumerate(shape):
6517  * if dim <= 0:
6518  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
6519  * self._shape[idx] = dim
6520  *
6521  */
6522  __Pyx_TraceLine(154,0,__PYX_ERR(2, 154, __pyx_L1_error))
6523  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 154, __pyx_L1_error)
6524  __Pyx_GOTREF(__pyx_t_5);
6525  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error)
6526  __Pyx_GOTREF(__pyx_t_6);
6527  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error)
6528  __Pyx_GOTREF(__pyx_t_10);
6529  __Pyx_GIVEREF(__pyx_t_5);
6530  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6531  __Pyx_GIVEREF(__pyx_t_6);
6532  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6533  __pyx_t_5 = 0;
6534  __pyx_t_6 = 0;
6535  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error)
6536  __Pyx_GOTREF(__pyx_t_6);
6537  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6538  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error)
6539  __Pyx_GOTREF(__pyx_t_10);
6540  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6541  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6542  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6543  __PYX_ERR(2, 154, __pyx_L1_error)
6544 
6545  /* "View.MemoryView":153
6546  *
6547  * for idx, dim in enumerate(shape):
6548  * if dim <= 0: # <<<<<<<<<<<<<<
6549  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6550  * self._shape[idx] = dim
6551  */
6552  }
6553 
6554  /* "View.MemoryView":155
6555  * if dim <= 0:
6556  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6557  * self._shape[idx] = dim # <<<<<<<<<<<<<<
6558  *
6559  * cdef char order
6560  */
6561  __Pyx_TraceLine(155,0,__PYX_ERR(2, 155, __pyx_L1_error))
6562  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6563 
6564  /* "View.MemoryView":152
6565  *
6566  *
6567  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6568  * if dim <= 0:
6569  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6570  */
6571  __Pyx_TraceLine(152,0,__PYX_ERR(2, 152, __pyx_L1_error))
6572  }
6573  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6574 
6575  /* "View.MemoryView":158
6576  *
6577  * cdef char order
6578  * if mode == 'fortran': # <<<<<<<<<<<<<<
6579  * order = b'F'
6580  * self.mode = u'fortran'
6581  */
6582  __Pyx_TraceLine(158,0,__PYX_ERR(2, 158, __pyx_L1_error))
6583  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
6584  if (__pyx_t_4) {
6585 
6586  /* "View.MemoryView":159
6587  * cdef char order
6588  * if mode == 'fortran':
6589  * order = b'F' # <<<<<<<<<<<<<<
6590  * self.mode = u'fortran'
6591  * elif mode == 'c':
6592  */
6593  __Pyx_TraceLine(159,0,__PYX_ERR(2, 159, __pyx_L1_error))
6594  __pyx_v_order = 'F';
6595 
6596  /* "View.MemoryView":160
6597  * if mode == 'fortran':
6598  * order = b'F'
6599  * self.mode = u'fortran' # <<<<<<<<<<<<<<
6600  * elif mode == 'c':
6601  * order = b'C'
6602  */
6603  __Pyx_TraceLine(160,0,__PYX_ERR(2, 160, __pyx_L1_error))
6604  __Pyx_INCREF(__pyx_n_u_fortran);
6605  __Pyx_GIVEREF(__pyx_n_u_fortran);
6606  __Pyx_GOTREF(__pyx_v_self->mode);
6607  __Pyx_DECREF(__pyx_v_self->mode);
6608  __pyx_v_self->mode = __pyx_n_u_fortran;
6609 
6610  /* "View.MemoryView":158
6611  *
6612  * cdef char order
6613  * if mode == 'fortran': # <<<<<<<<<<<<<<
6614  * order = b'F'
6615  * self.mode = u'fortran'
6616  */
6617  goto __pyx_L10;
6618  }
6619 
6620  /* "View.MemoryView":161
6621  * order = b'F'
6622  * self.mode = u'fortran'
6623  * elif mode == 'c': # <<<<<<<<<<<<<<
6624  * order = b'C'
6625  * self.mode = u'c'
6626  */
6627  __Pyx_TraceLine(161,0,__PYX_ERR(2, 161, __pyx_L1_error))
6628  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 161, __pyx_L1_error)
6629  if (likely(__pyx_t_4)) {
6630 
6631  /* "View.MemoryView":162
6632  * self.mode = u'fortran'
6633  * elif mode == 'c':
6634  * order = b'C' # <<<<<<<<<<<<<<
6635  * self.mode = u'c'
6636  * else:
6637  */
6638  __Pyx_TraceLine(162,0,__PYX_ERR(2, 162, __pyx_L1_error))
6639  __pyx_v_order = 'C';
6640 
6641  /* "View.MemoryView":163
6642  * elif mode == 'c':
6643  * order = b'C'
6644  * self.mode = u'c' # <<<<<<<<<<<<<<
6645  * else:
6646  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6647  */
6648  __Pyx_TraceLine(163,0,__PYX_ERR(2, 163, __pyx_L1_error))
6649  __Pyx_INCREF(__pyx_n_u_c);
6650  __Pyx_GIVEREF(__pyx_n_u_c);
6651  __Pyx_GOTREF(__pyx_v_self->mode);
6652  __Pyx_DECREF(__pyx_v_self->mode);
6653  __pyx_v_self->mode = __pyx_n_u_c;
6654 
6655  /* "View.MemoryView":161
6656  * order = b'F'
6657  * self.mode = u'fortran'
6658  * elif mode == 'c': # <<<<<<<<<<<<<<
6659  * order = b'C'
6660  * self.mode = u'c'
6661  */
6662  goto __pyx_L10;
6663  }
6664 
6665  /* "View.MemoryView":165
6666  * self.mode = u'c'
6667  * else:
6668  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
6669  *
6670  * self.len = fill_contig_strides_array(self._shape, self._strides,
6671  */
6672  __Pyx_TraceLine(165,0,__PYX_ERR(2, 165, __pyx_L1_error))
6673  /*else*/ {
6674  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 165, __pyx_L1_error)
6675  __Pyx_GOTREF(__pyx_t_3);
6676  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 165, __pyx_L1_error)
6677  __Pyx_GOTREF(__pyx_t_10);
6678  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6679  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6680  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6681  __PYX_ERR(2, 165, __pyx_L1_error)
6682  }
6683  __pyx_L10:;
6684 
6685  /* "View.MemoryView":167
6686  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6687  *
6688  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
6689  * itemsize, self.ndim, order)
6690  *
6691  */
6692  __Pyx_TraceLine(167,0,__PYX_ERR(2, 167, __pyx_L1_error))
6693  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6694 
6695  /* "View.MemoryView":170
6696  * itemsize, self.ndim, order)
6697  *
6698  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
6699  * self.dtype_is_object = format == b'O'
6700  * if allocate_buffer:
6701  */
6702  __Pyx_TraceLine(170,0,__PYX_ERR(2, 170, __pyx_L1_error))
6703  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6704 
6705  /* "View.MemoryView":171
6706  *
6707  * self.free_data = allocate_buffer
6708  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
6709  * if allocate_buffer:
6710  *
6711  */
6712  __Pyx_TraceLine(171,0,__PYX_ERR(2, 171, __pyx_L1_error))
6713  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 171, __pyx_L1_error)
6714  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 171, __pyx_L1_error)
6715  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6716  __pyx_v_self->dtype_is_object = __pyx_t_4;
6717 
6718  /* "View.MemoryView":172
6719  * self.free_data = allocate_buffer
6720  * self.dtype_is_object = format == b'O'
6721  * if allocate_buffer: # <<<<<<<<<<<<<<
6722  *
6723  *
6724  */
6725  __Pyx_TraceLine(172,0,__PYX_ERR(2, 172, __pyx_L1_error))
6726  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6727  if (__pyx_t_4) {
6728 
6729  /* "View.MemoryView":175
6730  *
6731  *
6732  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
6733  * if not self.data:
6734  * raise MemoryError("unable to allocate array data.")
6735  */
6736  __Pyx_TraceLine(175,0,__PYX_ERR(2, 175, __pyx_L1_error))
6737  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6738 
6739  /* "View.MemoryView":176
6740  *
6741  * self.data = <char *>malloc(self.len)
6742  * if not self.data: # <<<<<<<<<<<<<<
6743  * raise MemoryError("unable to allocate array data.")
6744  *
6745  */
6746  __Pyx_TraceLine(176,0,__PYX_ERR(2, 176, __pyx_L1_error))
6747  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6748  if (unlikely(__pyx_t_4)) {
6749 
6750  /* "View.MemoryView":177
6751  * self.data = <char *>malloc(self.len)
6752  * if not self.data:
6753  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
6754  *
6755  * if self.dtype_is_object:
6756  */
6757  __Pyx_TraceLine(177,0,__PYX_ERR(2, 177, __pyx_L1_error))
6758  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 177, __pyx_L1_error)
6759  __Pyx_GOTREF(__pyx_t_10);
6760  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6761  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6762  __PYX_ERR(2, 177, __pyx_L1_error)
6763 
6764  /* "View.MemoryView":176
6765  *
6766  * self.data = <char *>malloc(self.len)
6767  * if not self.data: # <<<<<<<<<<<<<<
6768  * raise MemoryError("unable to allocate array data.")
6769  *
6770  */
6771  }
6772 
6773  /* "View.MemoryView":179
6774  * raise MemoryError("unable to allocate array data.")
6775  *
6776  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6777  * p = <PyObject **> self.data
6778  * for i in range(self.len / itemsize):
6779  */
6780  __Pyx_TraceLine(179,0,__PYX_ERR(2, 179, __pyx_L1_error))
6781  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
6782  if (__pyx_t_4) {
6783 
6784  /* "View.MemoryView":180
6785  *
6786  * if self.dtype_is_object:
6787  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6788  * for i in range(self.len / itemsize):
6789  * p[i] = Py_None
6790  */
6791  __Pyx_TraceLine(180,0,__PYX_ERR(2, 180, __pyx_L1_error))
6792  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6793 
6794  /* "View.MemoryView":181
6795  * if self.dtype_is_object:
6796  * p = <PyObject **> self.data
6797  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
6798  * p[i] = Py_None
6799  * Py_INCREF(Py_None)
6800  */
6801  __Pyx_TraceLine(181,0,__PYX_ERR(2, 181, __pyx_L1_error))
6802  if (unlikely(__pyx_v_itemsize == 0)) {
6803  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6804  __PYX_ERR(2, 181, __pyx_L1_error)
6805  }
6806  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6807  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6808  __PYX_ERR(2, 181, __pyx_L1_error)
6809  }
6810  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
6811  __pyx_t_9 = __pyx_t_1;
6812  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
6813  __pyx_v_i = __pyx_t_11;
6814 
6815  /* "View.MemoryView":182
6816  * p = <PyObject **> self.data
6817  * for i in range(self.len / itemsize):
6818  * p[i] = Py_None # <<<<<<<<<<<<<<
6819  * Py_INCREF(Py_None)
6820  *
6821  */
6822  __Pyx_TraceLine(182,0,__PYX_ERR(2, 182, __pyx_L1_error))
6823  (__pyx_v_p[__pyx_v_i]) = Py_None;
6824 
6825  /* "View.MemoryView":183
6826  * for i in range(self.len / itemsize):
6827  * p[i] = Py_None
6828  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6829  *
6830  * @cname('getbuffer')
6831  */
6832  __Pyx_TraceLine(183,0,__PYX_ERR(2, 183, __pyx_L1_error))
6833  Py_INCREF(Py_None);
6834  }
6835 
6836  /* "View.MemoryView":179
6837  * raise MemoryError("unable to allocate array data.")
6838  *
6839  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6840  * p = <PyObject **> self.data
6841  * for i in range(self.len / itemsize):
6842  */
6843  }
6844 
6845  /* "View.MemoryView":172
6846  * self.free_data = allocate_buffer
6847  * self.dtype_is_object = format == b'O'
6848  * if allocate_buffer: # <<<<<<<<<<<<<<
6849  *
6850  *
6851  */
6852  }
6853 
6854  /* "View.MemoryView":123
6855  * cdef bint dtype_is_object
6856  *
6857  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6858  * mode="c", bint allocate_buffer=True):
6859  *
6860  */
6861 
6862  /* function exit code */
6863  __pyx_r = 0;
6864  goto __pyx_L0;
6865  __pyx_L1_error:;
6866  __Pyx_XDECREF(__pyx_t_3);
6867  __Pyx_XDECREF(__pyx_t_5);
6868  __Pyx_XDECREF(__pyx_t_6);
6869  __Pyx_XDECREF(__pyx_t_10);
6870  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6871  __pyx_r = -1;
6872  __pyx_L0:;
6873  __Pyx_XDECREF(__pyx_v_format);
6874  __Pyx_TraceReturn(Py_None, 0);
6875  __Pyx_RefNannyFinishContext();
6876  return __pyx_r;
6877 }
6878 
6879 /* "View.MemoryView":186
6880  *
6881  * @cname('getbuffer')
6882  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
6883  * cdef int bufmode = -1
6884  * if self.mode == u"c":
6885  */
6886 
6887 /* Python wrapper */
6888 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6889 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6890  int __pyx_r;
6891  __Pyx_RefNannyDeclarations
6892  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6893  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6894 
6895  /* function exit code */
6896  __Pyx_RefNannyFinishContext();
6897  return __pyx_r;
6898 }
6899 
6900 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6901  int __pyx_v_bufmode;
6902  int __pyx_r;
6903  __Pyx_TraceDeclarations
6904  __Pyx_RefNannyDeclarations
6905  int __pyx_t_1;
6906  int __pyx_t_2;
6907  PyObject *__pyx_t_3 = NULL;
6908  char *__pyx_t_4;
6909  Py_ssize_t __pyx_t_5;
6910  int __pyx_t_6;
6911  Py_ssize_t *__pyx_t_7;
6912  int __pyx_lineno = 0;
6913  const char *__pyx_filename = NULL;
6914  int __pyx_clineno = 0;
6915  if (__pyx_v_info == NULL) {
6916  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6917  return -1;
6918  }
6919  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6920  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6921  __Pyx_GIVEREF(__pyx_v_info->obj);
6922  __Pyx_TraceCall("__getbuffer__", __pyx_f[2], 186, 0, __PYX_ERR(2, 186, __pyx_L1_error));
6923 
6924  /* "View.MemoryView":187
6925  * @cname('getbuffer')
6926  * def __getbuffer__(self, Py_buffer *info, int flags):
6927  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
6928  * if self.mode == u"c":
6929  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6930  */
6931  __Pyx_TraceLine(187,0,__PYX_ERR(2, 187, __pyx_L1_error))
6932  __pyx_v_bufmode = -1;
6933 
6934  /* "View.MemoryView":188
6935  * def __getbuffer__(self, Py_buffer *info, int flags):
6936  * cdef int bufmode = -1
6937  * if self.mode == u"c": # <<<<<<<<<<<<<<
6938  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6939  * elif self.mode == u"fortran":
6940  */
6941  __Pyx_TraceLine(188,0,__PYX_ERR(2, 188, __pyx_L1_error))
6942  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 188, __pyx_L1_error)
6943  __pyx_t_2 = (__pyx_t_1 != 0);
6944  if (__pyx_t_2) {
6945 
6946  /* "View.MemoryView":189
6947  * cdef int bufmode = -1
6948  * if self.mode == u"c":
6949  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6950  * elif self.mode == u"fortran":
6951  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6952  */
6953  __Pyx_TraceLine(189,0,__PYX_ERR(2, 189, __pyx_L1_error))
6954  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6955 
6956  /* "View.MemoryView":188
6957  * def __getbuffer__(self, Py_buffer *info, int flags):
6958  * cdef int bufmode = -1
6959  * if self.mode == u"c": # <<<<<<<<<<<<<<
6960  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6961  * elif self.mode == u"fortran":
6962  */
6963  goto __pyx_L3;
6964  }
6965 
6966  /* "View.MemoryView":190
6967  * if self.mode == u"c":
6968  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6969  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6970  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6971  * if not (flags & bufmode):
6972  */
6973  __Pyx_TraceLine(190,0,__PYX_ERR(2, 190, __pyx_L1_error))
6974  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 190, __pyx_L1_error)
6975  __pyx_t_1 = (__pyx_t_2 != 0);
6976  if (__pyx_t_1) {
6977 
6978  /* "View.MemoryView":191
6979  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6980  * elif self.mode == u"fortran":
6981  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6982  * if not (flags & bufmode):
6983  * raise ValueError("Can only create a buffer that is contiguous in memory.")
6984  */
6985  __Pyx_TraceLine(191,0,__PYX_ERR(2, 191, __pyx_L1_error))
6986  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6987 
6988  /* "View.MemoryView":190
6989  * if self.mode == u"c":
6990  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6991  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6992  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6993  * if not (flags & bufmode):
6994  */
6995  }
6996  __pyx_L3:;
6997 
6998  /* "View.MemoryView":192
6999  * elif self.mode == u"fortran":
7000  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7001  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7002  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7003  * info.buf = self.data
7004  */
7005  __Pyx_TraceLine(192,0,__PYX_ERR(2, 192, __pyx_L1_error))
7006  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7007  if (unlikely(__pyx_t_1)) {
7008 
7009  /* "View.MemoryView":193
7010  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7011  * if not (flags & bufmode):
7012  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
7013  * info.buf = self.data
7014  * info.len = self.len
7015  */
7016  __Pyx_TraceLine(193,0,__PYX_ERR(2, 193, __pyx_L1_error))
7017  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 193, __pyx_L1_error)
7018  __Pyx_GOTREF(__pyx_t_3);
7019  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7020  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7021  __PYX_ERR(2, 193, __pyx_L1_error)
7022 
7023  /* "View.MemoryView":192
7024  * elif self.mode == u"fortran":
7025  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7026  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7027  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7028  * info.buf = self.data
7029  */
7030  }
7031 
7032  /* "View.MemoryView":194
7033  * if not (flags & bufmode):
7034  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7035  * info.buf = self.data # <<<<<<<<<<<<<<
7036  * info.len = self.len
7037  * info.ndim = self.ndim
7038  */
7039  __Pyx_TraceLine(194,0,__PYX_ERR(2, 194, __pyx_L1_error))
7040  __pyx_t_4 = __pyx_v_self->data;
7041  __pyx_v_info->buf = __pyx_t_4;
7042 
7043  /* "View.MemoryView":195
7044  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7045  * info.buf = self.data
7046  * info.len = self.len # <<<<<<<<<<<<<<
7047  * info.ndim = self.ndim
7048  * info.shape = self._shape
7049  */
7050  __Pyx_TraceLine(195,0,__PYX_ERR(2, 195, __pyx_L1_error))
7051  __pyx_t_5 = __pyx_v_self->len;
7052  __pyx_v_info->len = __pyx_t_5;
7053 
7054  /* "View.MemoryView":196
7055  * info.buf = self.data
7056  * info.len = self.len
7057  * info.ndim = self.ndim # <<<<<<<<<<<<<<
7058  * info.shape = self._shape
7059  * info.strides = self._strides
7060  */
7061  __Pyx_TraceLine(196,0,__PYX_ERR(2, 196, __pyx_L1_error))
7062  __pyx_t_6 = __pyx_v_self->ndim;
7063  __pyx_v_info->ndim = __pyx_t_6;
7064 
7065  /* "View.MemoryView":197
7066  * info.len = self.len
7067  * info.ndim = self.ndim
7068  * info.shape = self._shape # <<<<<<<<<<<<<<
7069  * info.strides = self._strides
7070  * info.suboffsets = NULL
7071  */
7072  __Pyx_TraceLine(197,0,__PYX_ERR(2, 197, __pyx_L1_error))
7073  __pyx_t_7 = __pyx_v_self->_shape;
7074  __pyx_v_info->shape = __pyx_t_7;
7075 
7076  /* "View.MemoryView":198
7077  * info.ndim = self.ndim
7078  * info.shape = self._shape
7079  * info.strides = self._strides # <<<<<<<<<<<<<<
7080  * info.suboffsets = NULL
7081  * info.itemsize = self.itemsize
7082  */
7083  __Pyx_TraceLine(198,0,__PYX_ERR(2, 198, __pyx_L1_error))
7084  __pyx_t_7 = __pyx_v_self->_strides;
7085  __pyx_v_info->strides = __pyx_t_7;
7086 
7087  /* "View.MemoryView":199
7088  * info.shape = self._shape
7089  * info.strides = self._strides
7090  * info.suboffsets = NULL # <<<<<<<<<<<<<<
7091  * info.itemsize = self.itemsize
7092  * info.readonly = 0
7093  */
7094  __Pyx_TraceLine(199,0,__PYX_ERR(2, 199, __pyx_L1_error))
7095  __pyx_v_info->suboffsets = NULL;
7096 
7097  /* "View.MemoryView":200
7098  * info.strides = self._strides
7099  * info.suboffsets = NULL
7100  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
7101  * info.readonly = 0
7102  *
7103  */
7104  __Pyx_TraceLine(200,0,__PYX_ERR(2, 200, __pyx_L1_error))
7105  __pyx_t_5 = __pyx_v_self->itemsize;
7106  __pyx_v_info->itemsize = __pyx_t_5;
7107 
7108  /* "View.MemoryView":201
7109  * info.suboffsets = NULL
7110  * info.itemsize = self.itemsize
7111  * info.readonly = 0 # <<<<<<<<<<<<<<
7112  *
7113  * if flags & PyBUF_FORMAT:
7114  */
7115  __Pyx_TraceLine(201,0,__PYX_ERR(2, 201, __pyx_L1_error))
7116  __pyx_v_info->readonly = 0;
7117 
7118  /* "View.MemoryView":203
7119  * info.readonly = 0
7120  *
7121  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7122  * info.format = self.format
7123  * else:
7124  */
7125  __Pyx_TraceLine(203,0,__PYX_ERR(2, 203, __pyx_L1_error))
7126  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7127  if (__pyx_t_1) {
7128 
7129  /* "View.MemoryView":204
7130  *
7131  * if flags & PyBUF_FORMAT:
7132  * info.format = self.format # <<<<<<<<<<<<<<
7133  * else:
7134  * info.format = NULL
7135  */
7136  __Pyx_TraceLine(204,0,__PYX_ERR(2, 204, __pyx_L1_error))
7137  __pyx_t_4 = __pyx_v_self->format;
7138  __pyx_v_info->format = __pyx_t_4;
7139 
7140  /* "View.MemoryView":203
7141  * info.readonly = 0
7142  *
7143  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7144  * info.format = self.format
7145  * else:
7146  */
7147  goto __pyx_L5;
7148  }
7149 
7150  /* "View.MemoryView":206
7151  * info.format = self.format
7152  * else:
7153  * info.format = NULL # <<<<<<<<<<<<<<
7154  *
7155  * info.obj = self
7156  */
7157  __Pyx_TraceLine(206,0,__PYX_ERR(2, 206, __pyx_L1_error))
7158  /*else*/ {
7159  __pyx_v_info->format = NULL;
7160  }
7161  __pyx_L5:;
7162 
7163  /* "View.MemoryView":208
7164  * info.format = NULL
7165  *
7166  * info.obj = self # <<<<<<<<<<<<<<
7167  *
7168  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7169  */
7170  __Pyx_TraceLine(208,0,__PYX_ERR(2, 208, __pyx_L1_error))
7171  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7172  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7173  __Pyx_GOTREF(__pyx_v_info->obj);
7174  __Pyx_DECREF(__pyx_v_info->obj);
7175  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7176 
7177  /* "View.MemoryView":186
7178  *
7179  * @cname('getbuffer')
7180  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7181  * cdef int bufmode = -1
7182  * if self.mode == u"c":
7183  */
7184 
7185  /* function exit code */
7186  __pyx_r = 0;
7187  goto __pyx_L0;
7188  __pyx_L1_error:;
7189  __Pyx_XDECREF(__pyx_t_3);
7190  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7191  __pyx_r = -1;
7192  if (__pyx_v_info->obj != NULL) {
7193  __Pyx_GOTREF(__pyx_v_info->obj);
7194  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7195  }
7196  goto __pyx_L2;
7197  __pyx_L0:;
7198  if (__pyx_v_info->obj == Py_None) {
7199  __Pyx_GOTREF(__pyx_v_info->obj);
7200  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7201  }
7202  __pyx_L2:;
7203  __Pyx_TraceReturn(Py_None, 0);
7204  __Pyx_RefNannyFinishContext();
7205  return __pyx_r;
7206 }
7207 
7208 /* "View.MemoryView":212
7209  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7210  *
7211  * def __dealloc__(array self): # <<<<<<<<<<<<<<
7212  * if self.callback_free_data != NULL:
7213  * self.callback_free_data(self.data)
7214  */
7215 
7216 /* Python wrapper */
7217 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
7218 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7219  __Pyx_RefNannyDeclarations
7220  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7221  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
7222 
7223  /* function exit code */
7224  __Pyx_RefNannyFinishContext();
7225 }
7226 
7227 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
7228  __Pyx_TraceDeclarations
7229  __Pyx_RefNannyDeclarations
7230  int __pyx_t_1;
7231  int __pyx_lineno = 0;
7232  const char *__pyx_filename = NULL;
7233  int __pyx_clineno = 0;
7234  __Pyx_RefNannySetupContext("__dealloc__", 0);
7235  __Pyx_TraceCall("__dealloc__", __pyx_f[2], 212, 0, __PYX_ERR(2, 212, __pyx_L1_error));
7236 
7237  /* "View.MemoryView":213
7238  *
7239  * def __dealloc__(array self):
7240  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7241  * self.callback_free_data(self.data)
7242  * elif self.free_data:
7243  */
7244  __Pyx_TraceLine(213,0,__PYX_ERR(2, 213, __pyx_L1_error))
7245  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7246  if (__pyx_t_1) {
7247 
7248  /* "View.MemoryView":214
7249  * def __dealloc__(array self):
7250  * if self.callback_free_data != NULL:
7251  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
7252  * elif self.free_data:
7253  * if self.dtype_is_object:
7254  */
7255  __Pyx_TraceLine(214,0,__PYX_ERR(2, 214, __pyx_L1_error))
7256  __pyx_v_self->callback_free_data(__pyx_v_self->data);
7257 
7258  /* "View.MemoryView":213
7259  *
7260  * def __dealloc__(array self):
7261  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7262  * self.callback_free_data(self.data)
7263  * elif self.free_data:
7264  */
7265  goto __pyx_L3;
7266  }
7267 
7268  /* "View.MemoryView":215
7269  * if self.callback_free_data != NULL:
7270  * self.callback_free_data(self.data)
7271  * elif self.free_data: # <<<<<<<<<<<<<<
7272  * if self.dtype_is_object:
7273  * refcount_objects_in_slice(self.data, self._shape,
7274  */
7275  __Pyx_TraceLine(215,0,__PYX_ERR(2, 215, __pyx_L1_error))
7276  __pyx_t_1 = (__pyx_v_self->free_data != 0);
7277  if (__pyx_t_1) {
7278 
7279  /* "View.MemoryView":216
7280  * self.callback_free_data(self.data)
7281  * elif self.free_data:
7282  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7283  * refcount_objects_in_slice(self.data, self._shape,
7284  * self._strides, self.ndim, False)
7285  */
7286  __Pyx_TraceLine(216,0,__PYX_ERR(2, 216, __pyx_L1_error))
7287  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7288  if (__pyx_t_1) {
7289 
7290  /* "View.MemoryView":217
7291  * elif self.free_data:
7292  * if self.dtype_is_object:
7293  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
7294  * self._strides, self.ndim, False)
7295  * free(self.data)
7296  */
7297  __Pyx_TraceLine(217,0,__PYX_ERR(2, 217, __pyx_L1_error))
7298  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7299 
7300  /* "View.MemoryView":216
7301  * self.callback_free_data(self.data)
7302  * elif self.free_data:
7303  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7304  * refcount_objects_in_slice(self.data, self._shape,
7305  * self._strides, self.ndim, False)
7306  */
7307  }
7308 
7309  /* "View.MemoryView":219
7310  * refcount_objects_in_slice(self.data, self._shape,
7311  * self._strides, self.ndim, False)
7312  * free(self.data) # <<<<<<<<<<<<<<
7313  * PyObject_Free(self._shape)
7314  *
7315  */
7316  __Pyx_TraceLine(219,0,__PYX_ERR(2, 219, __pyx_L1_error))
7317  free(__pyx_v_self->data);
7318 
7319  /* "View.MemoryView":215
7320  * if self.callback_free_data != NULL:
7321  * self.callback_free_data(self.data)
7322  * elif self.free_data: # <<<<<<<<<<<<<<
7323  * if self.dtype_is_object:
7324  * refcount_objects_in_slice(self.data, self._shape,
7325  */
7326  }
7327  __pyx_L3:;
7328 
7329  /* "View.MemoryView":220
7330  * self._strides, self.ndim, False)
7331  * free(self.data)
7332  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
7333  *
7334  * @property
7335  */
7336  __Pyx_TraceLine(220,0,__PYX_ERR(2, 220, __pyx_L1_error))
7337  PyObject_Free(__pyx_v_self->_shape);
7338 
7339  /* "View.MemoryView":212
7340  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7341  *
7342  * def __dealloc__(array self): # <<<<<<<<<<<<<<
7343  * if self.callback_free_data != NULL:
7344  * self.callback_free_data(self.data)
7345  */
7346 
7347  /* function exit code */
7348  goto __pyx_L0;
7349  __pyx_L1_error:;
7350  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7351  __pyx_L0:;
7352  __Pyx_TraceReturn(Py_None, 0);
7353  __Pyx_RefNannyFinishContext();
7354 }
7355 
7356 /* "View.MemoryView":223
7357  *
7358  * @property
7359  * def memview(self): # <<<<<<<<<<<<<<
7360  * return self.get_memview()
7361  *
7362  */
7363 
7364 /* Python wrapper */
7365 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
7366 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7367  PyObject *__pyx_r = 0;
7368  __Pyx_RefNannyDeclarations
7369  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7370  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
7371 
7372  /* function exit code */
7373  __Pyx_RefNannyFinishContext();
7374  return __pyx_r;
7375 }
7376 
7377 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
7378  PyObject *__pyx_r = NULL;
7379  __Pyx_TraceDeclarations
7380  __Pyx_RefNannyDeclarations
7381  PyObject *__pyx_t_1 = NULL;
7382  int __pyx_lineno = 0;
7383  const char *__pyx_filename = NULL;
7384  int __pyx_clineno = 0;
7385  __Pyx_RefNannySetupContext("__get__", 0);
7386  __Pyx_TraceCall("__get__", __pyx_f[2], 223, 0, __PYX_ERR(2, 223, __pyx_L1_error));
7387 
7388  /* "View.MemoryView":224
7389  * @property
7390  * def memview(self):
7391  * return self.get_memview() # <<<<<<<<<<<<<<
7392  *
7393  * @cname('get_memview')
7394  */
7395  __Pyx_TraceLine(224,0,__PYX_ERR(2, 224, __pyx_L1_error))
7396  __Pyx_XDECREF(__pyx_r);
7397  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 224, __pyx_L1_error)
7398  __Pyx_GOTREF(__pyx_t_1);
7399  __pyx_r = __pyx_t_1;
7400  __pyx_t_1 = 0;
7401  goto __pyx_L0;
7402 
7403  /* "View.MemoryView":223
7404  *
7405  * @property
7406  * def memview(self): # <<<<<<<<<<<<<<
7407  * return self.get_memview()
7408  *
7409  */
7410 
7411  /* function exit code */
7412  __pyx_L1_error:;
7413  __Pyx_XDECREF(__pyx_t_1);
7414  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7415  __pyx_r = NULL;
7416  __pyx_L0:;
7417  __Pyx_XGIVEREF(__pyx_r);
7418  __Pyx_TraceReturn(__pyx_r, 0);
7419  __Pyx_RefNannyFinishContext();
7420  return __pyx_r;
7421 }
7422 
7423 /* "View.MemoryView":227
7424  *
7425  * @cname('get_memview')
7426  * cdef get_memview(self): # <<<<<<<<<<<<<<
7427  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7428  * return memoryview(self, flags, self.dtype_is_object)
7429  */
7430 
7431 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
7432  int __pyx_v_flags;
7433  PyObject *__pyx_r = NULL;
7434  __Pyx_TraceDeclarations
7435  __Pyx_RefNannyDeclarations
7436  PyObject *__pyx_t_1 = NULL;
7437  PyObject *__pyx_t_2 = NULL;
7438  PyObject *__pyx_t_3 = NULL;
7439  int __pyx_lineno = 0;
7440  const char *__pyx_filename = NULL;
7441  int __pyx_clineno = 0;
7442  __Pyx_RefNannySetupContext("get_memview", 0);
7443  __Pyx_TraceCall("get_memview", __pyx_f[2], 227, 0, __PYX_ERR(2, 227, __pyx_L1_error));
7444 
7445  /* "View.MemoryView":228
7446  * @cname('get_memview')
7447  * cdef get_memview(self):
7448  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
7449  * return memoryview(self, flags, self.dtype_is_object)
7450  *
7451  */
7452  __Pyx_TraceLine(228,0,__PYX_ERR(2, 228, __pyx_L1_error))
7453  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7454 
7455  /* "View.MemoryView":229
7456  * cdef get_memview(self):
7457  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7458  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
7459  *
7460  * def __len__(self):
7461  */
7462  __Pyx_TraceLine(229,0,__PYX_ERR(2, 229, __pyx_L1_error))
7463  __Pyx_XDECREF(__pyx_r);
7464  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
7465  __Pyx_GOTREF(__pyx_t_1);
7466  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error)
7467  __Pyx_GOTREF(__pyx_t_2);
7468  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error)
7469  __Pyx_GOTREF(__pyx_t_3);
7470  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7471  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7472  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7473  __Pyx_GIVEREF(__pyx_t_1);
7474  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7475  __Pyx_GIVEREF(__pyx_t_2);
7476  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7477  __pyx_t_1 = 0;
7478  __pyx_t_2 = 0;
7479  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error)
7480  __Pyx_GOTREF(__pyx_t_2);
7481  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7482  __pyx_r = __pyx_t_2;
7483  __pyx_t_2 = 0;
7484  goto __pyx_L0;
7485 
7486  /* "View.MemoryView":227
7487  *
7488  * @cname('get_memview')
7489  * cdef get_memview(self): # <<<<<<<<<<<<<<
7490  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7491  * return memoryview(self, flags, self.dtype_is_object)
7492  */
7493 
7494  /* function exit code */
7495  __pyx_L1_error:;
7496  __Pyx_XDECREF(__pyx_t_1);
7497  __Pyx_XDECREF(__pyx_t_2);
7498  __Pyx_XDECREF(__pyx_t_3);
7499  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7500  __pyx_r = 0;
7501  __pyx_L0:;
7502  __Pyx_XGIVEREF(__pyx_r);
7503  __Pyx_TraceReturn(__pyx_r, 0);
7504  __Pyx_RefNannyFinishContext();
7505  return __pyx_r;
7506 }
7507 
7508 /* "View.MemoryView":231
7509  * return memoryview(self, flags, self.dtype_is_object)
7510  *
7511  * def __len__(self): # <<<<<<<<<<<<<<
7512  * return self._shape[0]
7513  *
7514  */
7515 
7516 /* Python wrapper */
7517 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
7518 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7519  Py_ssize_t __pyx_r;
7520  __Pyx_RefNannyDeclarations
7521  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
7522  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
7523 
7524  /* function exit code */
7525  __Pyx_RefNannyFinishContext();
7526  return __pyx_r;
7527 }
7528 
7529 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
7530  Py_ssize_t __pyx_r;
7531  __Pyx_TraceDeclarations
7532  __Pyx_RefNannyDeclarations
7533  int __pyx_lineno = 0;
7534  const char *__pyx_filename = NULL;
7535  int __pyx_clineno = 0;
7536  __Pyx_RefNannySetupContext("__len__", 0);
7537  __Pyx_TraceCall("__len__", __pyx_f[2], 231, 0, __PYX_ERR(2, 231, __pyx_L1_error));
7538 
7539  /* "View.MemoryView":232
7540  *
7541  * def __len__(self):
7542  * return self._shape[0] # <<<<<<<<<<<<<<
7543  *
7544  * def __getattr__(self, attr):
7545  */
7546  __Pyx_TraceLine(232,0,__PYX_ERR(2, 232, __pyx_L1_error))
7547  __pyx_r = (__pyx_v_self->_shape[0]);
7548  goto __pyx_L0;
7549 
7550  /* "View.MemoryView":231
7551  * return memoryview(self, flags, self.dtype_is_object)
7552  *
7553  * def __len__(self): # <<<<<<<<<<<<<<
7554  * return self._shape[0]
7555  *
7556  */
7557 
7558  /* function exit code */
7559  __pyx_L1_error:;
7560  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7561  __pyx_r = -1;
7562  __pyx_L0:;
7563  __Pyx_TraceReturn(Py_None, 0);
7564  __Pyx_RefNannyFinishContext();
7565  return __pyx_r;
7566 }
7567 
7568 /* "View.MemoryView":234
7569  * return self._shape[0]
7570  *
7571  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7572  * return getattr(self.memview, attr)
7573  *
7574  */
7575 
7576 /* Python wrapper */
7577 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
7578 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7579  PyObject *__pyx_r = 0;
7580  __Pyx_RefNannyDeclarations
7581  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
7582  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7583 
7584  /* function exit code */
7585  __Pyx_RefNannyFinishContext();
7586  return __pyx_r;
7587 }
7588 
7589 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7590  PyObject *__pyx_r = NULL;
7591  __Pyx_TraceDeclarations
7592  __Pyx_RefNannyDeclarations
7593  PyObject *__pyx_t_1 = NULL;
7594  PyObject *__pyx_t_2 = NULL;
7595  int __pyx_lineno = 0;
7596  const char *__pyx_filename = NULL;
7597  int __pyx_clineno = 0;
7598  __Pyx_RefNannySetupContext("__getattr__", 0);
7599  __Pyx_TraceCall("__getattr__", __pyx_f[2], 234, 0, __PYX_ERR(2, 234, __pyx_L1_error));
7600 
7601  /* "View.MemoryView":235
7602  *
7603  * def __getattr__(self, attr):
7604  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
7605  *
7606  * def __getitem__(self, item):
7607  */
7608  __Pyx_TraceLine(235,0,__PYX_ERR(2, 235, __pyx_L1_error))
7609  __Pyx_XDECREF(__pyx_r);
7610  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error)
7611  __Pyx_GOTREF(__pyx_t_1);
7612  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error)
7613  __Pyx_GOTREF(__pyx_t_2);
7614  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7615  __pyx_r = __pyx_t_2;
7616  __pyx_t_2 = 0;
7617  goto __pyx_L0;
7618 
7619  /* "View.MemoryView":234
7620  * return self._shape[0]
7621  *
7622  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7623  * return getattr(self.memview, attr)
7624  *
7625  */
7626 
7627  /* function exit code */
7628  __pyx_L1_error:;
7629  __Pyx_XDECREF(__pyx_t_1);
7630  __Pyx_XDECREF(__pyx_t_2);
7631  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7632  __pyx_r = NULL;
7633  __pyx_L0:;
7634  __Pyx_XGIVEREF(__pyx_r);
7635  __Pyx_TraceReturn(__pyx_r, 0);
7636  __Pyx_RefNannyFinishContext();
7637  return __pyx_r;
7638 }
7639 
7640 /* "View.MemoryView":237
7641  * return getattr(self.memview, attr)
7642  *
7643  * def __getitem__(self, item): # <<<<<<<<<<<<<<
7644  * return self.memview[item]
7645  *
7646  */
7647 
7648 /* Python wrapper */
7649 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
7650 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7651  PyObject *__pyx_r = 0;
7652  __Pyx_RefNannyDeclarations
7653  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
7654  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7655 
7656  /* function exit code */
7657  __Pyx_RefNannyFinishContext();
7658  return __pyx_r;
7659 }
7660 
7661 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7662  PyObject *__pyx_r = NULL;
7663  __Pyx_TraceDeclarations
7664  __Pyx_RefNannyDeclarations
7665  PyObject *__pyx_t_1 = NULL;
7666  PyObject *__pyx_t_2 = NULL;
7667  int __pyx_lineno = 0;
7668  const char *__pyx_filename = NULL;
7669  int __pyx_clineno = 0;
7670  __Pyx_RefNannySetupContext("__getitem__", 0);
7671  __Pyx_TraceCall("__getitem__", __pyx_f[2], 237, 0, __PYX_ERR(2, 237, __pyx_L1_error));
7672 
7673  /* "View.MemoryView":238
7674  *
7675  * def __getitem__(self, item):
7676  * return self.memview[item] # <<<<<<<<<<<<<<
7677  *
7678  * def __setitem__(self, item, value):
7679  */
7680  __Pyx_TraceLine(238,0,__PYX_ERR(2, 238, __pyx_L1_error))
7681  __Pyx_XDECREF(__pyx_r);
7682  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error)
7683  __Pyx_GOTREF(__pyx_t_1);
7684  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error)
7685  __Pyx_GOTREF(__pyx_t_2);
7686  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7687  __pyx_r = __pyx_t_2;
7688  __pyx_t_2 = 0;
7689  goto __pyx_L0;
7690 
7691  /* "View.MemoryView":237
7692  * return getattr(self.memview, attr)
7693  *
7694  * def __getitem__(self, item): # <<<<<<<<<<<<<<
7695  * return self.memview[item]
7696  *
7697  */
7698 
7699  /* function exit code */
7700  __pyx_L1_error:;
7701  __Pyx_XDECREF(__pyx_t_1);
7702  __Pyx_XDECREF(__pyx_t_2);
7703  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7704  __pyx_r = NULL;
7705  __pyx_L0:;
7706  __Pyx_XGIVEREF(__pyx_r);
7707  __Pyx_TraceReturn(__pyx_r, 0);
7708  __Pyx_RefNannyFinishContext();
7709  return __pyx_r;
7710 }
7711 
7712 /* "View.MemoryView":240
7713  * return self.memview[item]
7714  *
7715  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7716  * self.memview[item] = value
7717  *
7718  */
7719 
7720 /* Python wrapper */
7721 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
7722 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7723  int __pyx_r;
7724  __Pyx_RefNannyDeclarations
7725  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7726  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7727 
7728  /* function exit code */
7729  __Pyx_RefNannyFinishContext();
7730  return __pyx_r;
7731 }
7732 
7733 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7734  int __pyx_r;
7735  __Pyx_TraceDeclarations
7736  __Pyx_RefNannyDeclarations
7737  PyObject *__pyx_t_1 = NULL;
7738  int __pyx_lineno = 0;
7739  const char *__pyx_filename = NULL;
7740  int __pyx_clineno = 0;
7741  __Pyx_RefNannySetupContext("__setitem__", 0);
7742  __Pyx_TraceCall("__setitem__", __pyx_f[2], 240, 0, __PYX_ERR(2, 240, __pyx_L1_error));
7743 
7744  /* "View.MemoryView":241
7745  *
7746  * def __setitem__(self, item, value):
7747  * self.memview[item] = value # <<<<<<<<<<<<<<
7748  *
7749  *
7750  */
7751  __Pyx_TraceLine(241,0,__PYX_ERR(2, 241, __pyx_L1_error))
7752  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 241, __pyx_L1_error)
7753  __Pyx_GOTREF(__pyx_t_1);
7754  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 241, __pyx_L1_error)
7755  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7756 
7757  /* "View.MemoryView":240
7758  * return self.memview[item]
7759  *
7760  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7761  * self.memview[item] = value
7762  *
7763  */
7764 
7765  /* function exit code */
7766  __pyx_r = 0;
7767  goto __pyx_L0;
7768  __pyx_L1_error:;
7769  __Pyx_XDECREF(__pyx_t_1);
7770  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7771  __pyx_r = -1;
7772  __pyx_L0:;
7773  __Pyx_TraceReturn(Py_None, 0);
7774  __Pyx_RefNannyFinishContext();
7775  return __pyx_r;
7776 }
7777 
7778 /* "(tree fragment)":1
7779  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7780  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7781  * def __setstate_cython__(self, __pyx_state):
7782  */
7783 
7784 /* Python wrapper */
7785 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7786 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
7787 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7788  PyObject *__pyx_r = 0;
7789  __Pyx_RefNannyDeclarations
7790  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7791  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7792 
7793  /* function exit code */
7794  __Pyx_RefNannyFinishContext();
7795  return __pyx_r;
7796 }
7797 
7798 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7799  PyObject *__pyx_r = NULL;
7800  __Pyx_TraceDeclarations
7801  __Pyx_RefNannyDeclarations
7802  PyObject *__pyx_t_1 = NULL;
7803  int __pyx_lineno = 0;
7804  const char *__pyx_filename = NULL;
7805  int __pyx_clineno = 0;
7806  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7807  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
7808 
7809  /* "(tree fragment)":2
7810  * def __reduce_cython__(self):
7811  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7812  * def __setstate_cython__(self, __pyx_state):
7813  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7814  */
7815  __Pyx_TraceLine(2,0,__PYX_ERR(2, 2, __pyx_L1_error))
7816  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
7817  __Pyx_GOTREF(__pyx_t_1);
7818  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7819  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7820  __PYX_ERR(2, 2, __pyx_L1_error)
7821 
7822  /* "(tree fragment)":1
7823  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7824  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7825  * def __setstate_cython__(self, __pyx_state):
7826  */
7827 
7828  /* function exit code */
7829  __pyx_L1_error:;
7830  __Pyx_XDECREF(__pyx_t_1);
7831  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7832  __pyx_r = NULL;
7833  __Pyx_XGIVEREF(__pyx_r);
7834  __Pyx_TraceReturn(__pyx_r, 0);
7835  __Pyx_RefNannyFinishContext();
7836  return __pyx_r;
7837 }
7838 
7839 /* "(tree fragment)":3
7840  * def __reduce_cython__(self):
7841  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7842  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7843  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7844  */
7845 
7846 /* Python wrapper */
7847 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7848 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
7849 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7850  PyObject *__pyx_r = 0;
7851  __Pyx_RefNannyDeclarations
7852  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7853  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7854 
7855  /* function exit code */
7856  __Pyx_RefNannyFinishContext();
7857  return __pyx_r;
7858 }
7859 
7860 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7861  PyObject *__pyx_r = NULL;
7862  __Pyx_TraceDeclarations
7863  __Pyx_RefNannyDeclarations
7864  PyObject *__pyx_t_1 = NULL;
7865  int __pyx_lineno = 0;
7866  const char *__pyx_filename = NULL;
7867  int __pyx_clineno = 0;
7868  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7869  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 3, 0, __PYX_ERR(2, 3, __pyx_L1_error));
7870 
7871  /* "(tree fragment)":4
7872  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7873  * def __setstate_cython__(self, __pyx_state):
7874  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7875  */
7876  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
7877  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
7878  __Pyx_GOTREF(__pyx_t_1);
7879  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7880  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7881  __PYX_ERR(2, 4, __pyx_L1_error)
7882 
7883  /* "(tree fragment)":3
7884  * def __reduce_cython__(self):
7885  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7886  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7887  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7888  */
7889 
7890  /* function exit code */
7891  __pyx_L1_error:;
7892  __Pyx_XDECREF(__pyx_t_1);
7893  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7894  __pyx_r = NULL;
7895  __Pyx_XGIVEREF(__pyx_r);
7896  __Pyx_TraceReturn(__pyx_r, 0);
7897  __Pyx_RefNannyFinishContext();
7898  return __pyx_r;
7899 }
7900 
7901 /* "View.MemoryView":245
7902  *
7903  * @cname("__pyx_array_new")
7904  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
7905  * char *mode, char *buf):
7906  * cdef array result
7907  */
7908 
7909 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
7910  struct __pyx_array_obj *__pyx_v_result = 0;
7911  struct __pyx_array_obj *__pyx_r = NULL;
7912  __Pyx_TraceDeclarations
7913  __Pyx_RefNannyDeclarations
7914  int __pyx_t_1;
7915  PyObject *__pyx_t_2 = NULL;
7916  PyObject *__pyx_t_3 = NULL;
7917  PyObject *__pyx_t_4 = NULL;
7918  PyObject *__pyx_t_5 = NULL;
7919  int __pyx_lineno = 0;
7920  const char *__pyx_filename = NULL;
7921  int __pyx_clineno = 0;
7922  __Pyx_RefNannySetupContext("array_cwrapper", 0);
7923  __Pyx_TraceCall("array_cwrapper", __pyx_f[2], 245, 0, __PYX_ERR(2, 245, __pyx_L1_error));
7924 
7925  /* "View.MemoryView":249
7926  * cdef array result
7927  *
7928  * if buf == NULL: # <<<<<<<<<<<<<<
7929  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7930  * else:
7931  */
7932  __Pyx_TraceLine(249,0,__PYX_ERR(2, 249, __pyx_L1_error))
7933  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
7934  if (__pyx_t_1) {
7935 
7936  /* "View.MemoryView":250
7937  *
7938  * if buf == NULL:
7939  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
7940  * else:
7941  * result = array(shape, itemsize, format, mode.decode('ASCII'),
7942  */
7943  __Pyx_TraceLine(250,0,__PYX_ERR(2, 250, __pyx_L1_error))
7944  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error)
7945  __Pyx_GOTREF(__pyx_t_2);
7946  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error)
7947  __Pyx_GOTREF(__pyx_t_3);
7948  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error)
7949  __Pyx_GOTREF(__pyx_t_4);
7950  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error)
7951  __Pyx_GOTREF(__pyx_t_5);
7952  __Pyx_INCREF(__pyx_v_shape);
7953  __Pyx_GIVEREF(__pyx_v_shape);
7954  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
7955  __Pyx_GIVEREF(__pyx_t_2);
7956  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
7957  __Pyx_GIVEREF(__pyx_t_3);
7958  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
7959  __Pyx_GIVEREF(__pyx_t_4);
7960  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
7961  __pyx_t_2 = 0;
7962  __pyx_t_3 = 0;
7963  __pyx_t_4 = 0;
7964  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error)
7965  __Pyx_GOTREF(__pyx_t_4);
7966  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7967  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
7968  __pyx_t_4 = 0;
7969 
7970  /* "View.MemoryView":249
7971  * cdef array result
7972  *
7973  * if buf == NULL: # <<<<<<<<<<<<<<
7974  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7975  * else:
7976  */
7977  goto __pyx_L3;
7978  }
7979 
7980  /* "View.MemoryView":252
7981  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7982  * else:
7983  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
7984  * allocate_buffer=False)
7985  * result.data = buf
7986  */
7987  __Pyx_TraceLine(252,0,__PYX_ERR(2, 252, __pyx_L1_error))
7988  /*else*/ {
7989  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 252, __pyx_L1_error)
7990  __Pyx_GOTREF(__pyx_t_4);
7991  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error)
7992  __Pyx_GOTREF(__pyx_t_5);
7993  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
7994  __Pyx_GOTREF(__pyx_t_3);
7995  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 252, __pyx_L1_error)
7996  __Pyx_GOTREF(__pyx_t_2);
7997  __Pyx_INCREF(__pyx_v_shape);
7998  __Pyx_GIVEREF(__pyx_v_shape);
7999  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8000  __Pyx_GIVEREF(__pyx_t_4);
8001  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8002  __Pyx_GIVEREF(__pyx_t_5);
8003  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8004  __Pyx_GIVEREF(__pyx_t_3);
8005  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8006  __pyx_t_4 = 0;
8007  __pyx_t_5 = 0;
8008  __pyx_t_3 = 0;
8009 
8010  /* "View.MemoryView":253
8011  * else:
8012  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8013  * allocate_buffer=False) # <<<<<<<<<<<<<<
8014  * result.data = buf
8015  *
8016  */
8017  __Pyx_TraceLine(253,0,__PYX_ERR(2, 253, __pyx_L1_error))
8018  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 253, __pyx_L1_error)
8019  __Pyx_GOTREF(__pyx_t_3);
8020  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 253, __pyx_L1_error)
8021 
8022  /* "View.MemoryView":252
8023  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8024  * else:
8025  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8026  * allocate_buffer=False)
8027  * result.data = buf
8028  */
8029  __Pyx_TraceLine(252,0,__PYX_ERR(2, 252, __pyx_L1_error))
8030  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error)
8031  __Pyx_GOTREF(__pyx_t_5);
8032  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8033  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8034  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
8035  __pyx_t_5 = 0;
8036 
8037  /* "View.MemoryView":254
8038  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8039  * allocate_buffer=False)
8040  * result.data = buf # <<<<<<<<<<<<<<
8041  *
8042  * return result
8043  */
8044  __Pyx_TraceLine(254,0,__PYX_ERR(2, 254, __pyx_L1_error))
8045  __pyx_v_result->data = __pyx_v_buf;
8046  }
8047  __pyx_L3:;
8048 
8049  /* "View.MemoryView":256
8050  * result.data = buf
8051  *
8052  * return result # <<<<<<<<<<<<<<
8053  *
8054  *
8055  */
8056  __Pyx_TraceLine(256,0,__PYX_ERR(2, 256, __pyx_L1_error))
8057  __Pyx_XDECREF(((PyObject *)__pyx_r));
8058  __Pyx_INCREF(((PyObject *)__pyx_v_result));
8059  __pyx_r = __pyx_v_result;
8060  goto __pyx_L0;
8061 
8062  /* "View.MemoryView":245
8063  *
8064  * @cname("__pyx_array_new")
8065  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8066  * char *mode, char *buf):
8067  * cdef array result
8068  */
8069 
8070  /* function exit code */
8071  __pyx_L1_error:;
8072  __Pyx_XDECREF(__pyx_t_2);
8073  __Pyx_XDECREF(__pyx_t_3);
8074  __Pyx_XDECREF(__pyx_t_4);
8075  __Pyx_XDECREF(__pyx_t_5);
8076  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8077  __pyx_r = 0;
8078  __pyx_L0:;
8079  __Pyx_XDECREF((PyObject *)__pyx_v_result);
8080  __Pyx_XGIVEREF((PyObject *)__pyx_r);
8081  __Pyx_TraceReturn(__pyx_r, 0);
8082  __Pyx_RefNannyFinishContext();
8083  return __pyx_r;
8084 }
8085 
8086 /* "View.MemoryView":282
8087  * cdef class Enum(object):
8088  * cdef object name
8089  * def __init__(self, name): # <<<<<<<<<<<<<<
8090  * self.name = name
8091  * def __repr__(self):
8092  */
8093 
8094 /* Python wrapper */
8095 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8096 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8097  PyObject *__pyx_v_name = 0;
8098  int __pyx_lineno = 0;
8099  const char *__pyx_filename = NULL;
8100  int __pyx_clineno = 0;
8101  int __pyx_r;
8102  __Pyx_RefNannyDeclarations
8103  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8104  {
8105  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8106  PyObject* values[1] = {0};
8107  if (unlikely(__pyx_kwds)) {
8108  Py_ssize_t kw_args;
8109  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8110  switch (pos_args) {
8111  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8112  CYTHON_FALLTHROUGH;
8113  case 0: break;
8114  default: goto __pyx_L5_argtuple_error;
8115  }
8116  kw_args = PyDict_Size(__pyx_kwds);
8117  switch (pos_args) {
8118  case 0:
8119  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8120  else goto __pyx_L5_argtuple_error;
8121  }
8122  if (unlikely(kw_args > 0)) {
8123  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 282, __pyx_L3_error)
8124  }
8125  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8126  goto __pyx_L5_argtuple_error;
8127  } else {
8128  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8129  }
8130  __pyx_v_name = values[0];
8131  }
8132  goto __pyx_L4_argument_unpacking_done;
8133  __pyx_L5_argtuple_error:;
8134  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 282, __pyx_L3_error)
8135  __pyx_L3_error:;
8136  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8137  __Pyx_RefNannyFinishContext();
8138  return -1;
8139  __pyx_L4_argument_unpacking_done:;
8140  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8141 
8142  /* function exit code */
8143  __Pyx_RefNannyFinishContext();
8144  return __pyx_r;
8145 }
8146 
8147 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8148  int __pyx_r;
8149  __Pyx_TraceDeclarations
8150  __Pyx_RefNannyDeclarations
8151  int __pyx_lineno = 0;
8152  const char *__pyx_filename = NULL;
8153  int __pyx_clineno = 0;
8154  __Pyx_RefNannySetupContext("__init__", 0);
8155  __Pyx_TraceCall("__init__", __pyx_f[2], 282, 0, __PYX_ERR(2, 282, __pyx_L1_error));
8156 
8157  /* "View.MemoryView":283
8158  * cdef object name
8159  * def __init__(self, name):
8160  * self.name = name # <<<<<<<<<<<<<<
8161  * def __repr__(self):
8162  * return self.name
8163  */
8164  __Pyx_TraceLine(283,0,__PYX_ERR(2, 283, __pyx_L1_error))
8165  __Pyx_INCREF(__pyx_v_name);
8166  __Pyx_GIVEREF(__pyx_v_name);
8167  __Pyx_GOTREF(__pyx_v_self->name);
8168  __Pyx_DECREF(__pyx_v_self->name);
8169  __pyx_v_self->name = __pyx_v_name;
8170 
8171  /* "View.MemoryView":282
8172  * cdef class Enum(object):
8173  * cdef object name
8174  * def __init__(self, name): # <<<<<<<<<<<<<<
8175  * self.name = name
8176  * def __repr__(self):
8177  */
8178 
8179  /* function exit code */
8180  __pyx_r = 0;
8181  goto __pyx_L0;
8182  __pyx_L1_error:;
8183  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8184  __pyx_r = -1;
8185  __pyx_L0:;
8186  __Pyx_TraceReturn(Py_None, 0);
8187  __Pyx_RefNannyFinishContext();
8188  return __pyx_r;
8189 }
8190 
8191 /* "View.MemoryView":284
8192  * def __init__(self, name):
8193  * self.name = name
8194  * def __repr__(self): # <<<<<<<<<<<<<<
8195  * return self.name
8196  *
8197  */
8198 
8199 /* Python wrapper */
8200 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
8201 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8202  PyObject *__pyx_r = 0;
8203  __Pyx_RefNannyDeclarations
8204  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
8205  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8206 
8207  /* function exit code */
8208  __Pyx_RefNannyFinishContext();
8209  return __pyx_r;
8210 }
8211 
8212 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8213  PyObject *__pyx_r = NULL;
8214  __Pyx_TraceDeclarations
8215  __Pyx_RefNannyDeclarations
8216  int __pyx_lineno = 0;
8217  const char *__pyx_filename = NULL;
8218  int __pyx_clineno = 0;
8219  __Pyx_RefNannySetupContext("__repr__", 0);
8220  __Pyx_TraceCall("__repr__", __pyx_f[2], 284, 0, __PYX_ERR(2, 284, __pyx_L1_error));
8221 
8222  /* "View.MemoryView":285
8223  * self.name = name
8224  * def __repr__(self):
8225  * return self.name # <<<<<<<<<<<<<<
8226  *
8227  * cdef generic = Enum("<strided and direct or indirect>")
8228  */
8229  __Pyx_TraceLine(285,0,__PYX_ERR(2, 285, __pyx_L1_error))
8230  __Pyx_XDECREF(__pyx_r);
8231  __Pyx_INCREF(__pyx_v_self->name);
8232  __pyx_r = __pyx_v_self->name;
8233  goto __pyx_L0;
8234 
8235  /* "View.MemoryView":284
8236  * def __init__(self, name):
8237  * self.name = name
8238  * def __repr__(self): # <<<<<<<<<<<<<<
8239  * return self.name
8240  *
8241  */
8242 
8243  /* function exit code */
8244  __pyx_L1_error:;
8245  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8246  __pyx_r = NULL;
8247  __pyx_L0:;
8248  __Pyx_XGIVEREF(__pyx_r);
8249  __Pyx_TraceReturn(__pyx_r, 0);
8250  __Pyx_RefNannyFinishContext();
8251  return __pyx_r;
8252 }
8253 
8254 /* "(tree fragment)":1
8255  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8256  * cdef tuple state
8257  * cdef object _dict
8258  */
8259 
8260 /* Python wrapper */
8261 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8262 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
8263 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8264  PyObject *__pyx_r = 0;
8265  __Pyx_RefNannyDeclarations
8266  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8267  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8268 
8269  /* function exit code */
8270  __Pyx_RefNannyFinishContext();
8271  return __pyx_r;
8272 }
8273 
8274 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8275  PyObject *__pyx_v_state = 0;
8276  PyObject *__pyx_v__dict = 0;
8277  int __pyx_v_use_setstate;
8278  PyObject *__pyx_r = NULL;
8279  __Pyx_TraceDeclarations
8280  __Pyx_RefNannyDeclarations
8281  PyObject *__pyx_t_1 = NULL;
8282  int __pyx_t_2;
8283  int __pyx_t_3;
8284  PyObject *__pyx_t_4 = NULL;
8285  PyObject *__pyx_t_5 = NULL;
8286  int __pyx_lineno = 0;
8287  const char *__pyx_filename = NULL;
8288  int __pyx_clineno = 0;
8289  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8290  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
8291 
8292  /* "(tree fragment)":5
8293  * cdef object _dict
8294  * cdef bint use_setstate
8295  * state = (self.name,) # <<<<<<<<<<<<<<
8296  * _dict = getattr(self, '__dict__', None)
8297  * if _dict is not None:
8298  */
8299  __Pyx_TraceLine(5,0,__PYX_ERR(2, 5, __pyx_L1_error))
8300  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
8301  __Pyx_GOTREF(__pyx_t_1);
8302  __Pyx_INCREF(__pyx_v_self->name);
8303  __Pyx_GIVEREF(__pyx_v_self->name);
8304  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
8305  __pyx_v_state = ((PyObject*)__pyx_t_1);
8306  __pyx_t_1 = 0;
8307 
8308  /* "(tree fragment)":6
8309  * cdef bint use_setstate
8310  * state = (self.name,)
8311  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
8312  * if _dict is not None:
8313  * state += (_dict,)
8314  */
8315  __Pyx_TraceLine(6,0,__PYX_ERR(2, 6, __pyx_L1_error))
8316  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
8317  __Pyx_GOTREF(__pyx_t_1);
8318  __pyx_v__dict = __pyx_t_1;
8319  __pyx_t_1 = 0;
8320 
8321  /* "(tree fragment)":7
8322  * state = (self.name,)
8323  * _dict = getattr(self, '__dict__', None)
8324  * if _dict is not None: # <<<<<<<<<<<<<<
8325  * state += (_dict,)
8326  * use_setstate = True
8327  */
8328  __Pyx_TraceLine(7,0,__PYX_ERR(2, 7, __pyx_L1_error))
8329  __pyx_t_2 = (__pyx_v__dict != Py_None);
8330  __pyx_t_3 = (__pyx_t_2 != 0);
8331  if (__pyx_t_3) {
8332 
8333  /* "(tree fragment)":8
8334  * _dict = getattr(self, '__dict__', None)
8335  * if _dict is not None:
8336  * state += (_dict,) # <<<<<<<<<<<<<<
8337  * use_setstate = True
8338  * else:
8339  */
8340  __Pyx_TraceLine(8,0,__PYX_ERR(2, 8, __pyx_L1_error))
8341  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
8342  __Pyx_GOTREF(__pyx_t_1);
8343  __Pyx_INCREF(__pyx_v__dict);
8344  __Pyx_GIVEREF(__pyx_v__dict);
8345  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
8346  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
8347  __Pyx_GOTREF(__pyx_t_4);
8348  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8349  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8350  __pyx_t_4 = 0;
8351 
8352  /* "(tree fragment)":9
8353  * if _dict is not None:
8354  * state += (_dict,)
8355  * use_setstate = True # <<<<<<<<<<<<<<
8356  * else:
8357  * use_setstate = self.name is not None
8358  */
8359  __Pyx_TraceLine(9,0,__PYX_ERR(2, 9, __pyx_L1_error))
8360  __pyx_v_use_setstate = 1;
8361 
8362  /* "(tree fragment)":7
8363  * state = (self.name,)
8364  * _dict = getattr(self, '__dict__', None)
8365  * if _dict is not None: # <<<<<<<<<<<<<<
8366  * state += (_dict,)
8367  * use_setstate = True
8368  */
8369  goto __pyx_L3;
8370  }
8371 
8372  /* "(tree fragment)":11
8373  * use_setstate = True
8374  * else:
8375  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
8376  * if use_setstate:
8377  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8378  */
8379  __Pyx_TraceLine(11,0,__PYX_ERR(2, 11, __pyx_L1_error))
8380  /*else*/ {
8381  __pyx_t_3 = (__pyx_v_self->name != Py_None);
8382  __pyx_v_use_setstate = __pyx_t_3;
8383  }
8384  __pyx_L3:;
8385 
8386  /* "(tree fragment)":12
8387  * else:
8388  * use_setstate = self.name is not None
8389  * if use_setstate: # <<<<<<<<<<<<<<
8390  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8391  * else:
8392  */
8393  __Pyx_TraceLine(12,0,__PYX_ERR(2, 12, __pyx_L1_error))
8394  __pyx_t_3 = (__pyx_v_use_setstate != 0);
8395  if (__pyx_t_3) {
8396 
8397  /* "(tree fragment)":13
8398  * use_setstate = self.name is not None
8399  * if use_setstate:
8400  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
8401  * else:
8402  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8403  */
8404  __Pyx_TraceLine(13,0,__PYX_ERR(2, 13, __pyx_L1_error))
8405  __Pyx_XDECREF(__pyx_r);
8406  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
8407  __Pyx_GOTREF(__pyx_t_4);
8408  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
8409  __Pyx_GOTREF(__pyx_t_1);
8410  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8411  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8412  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8413  __Pyx_INCREF(__pyx_int_184977713);
8414  __Pyx_GIVEREF(__pyx_int_184977713);
8415  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8416  __Pyx_INCREF(Py_None);
8417  __Pyx_GIVEREF(Py_None);
8418  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
8419  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
8420  __Pyx_GOTREF(__pyx_t_5);
8421  __Pyx_GIVEREF(__pyx_t_4);
8422  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
8423  __Pyx_GIVEREF(__pyx_t_1);
8424  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8425  __Pyx_INCREF(__pyx_v_state);
8426  __Pyx_GIVEREF(__pyx_v_state);
8427  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8428  __pyx_t_4 = 0;
8429  __pyx_t_1 = 0;
8430  __pyx_r = __pyx_t_5;
8431  __pyx_t_5 = 0;
8432  goto __pyx_L0;
8433 
8434  /* "(tree fragment)":12
8435  * else:
8436  * use_setstate = self.name is not None
8437  * if use_setstate: # <<<<<<<<<<<<<<
8438  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8439  * else:
8440  */
8441  }
8442 
8443  /* "(tree fragment)":15
8444  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8445  * else:
8446  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
8447  * def __setstate_cython__(self, __pyx_state):
8448  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8449  */
8450  __Pyx_TraceLine(15,0,__PYX_ERR(2, 15, __pyx_L1_error))
8451  /*else*/ {
8452  __Pyx_XDECREF(__pyx_r);
8453  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
8454  __Pyx_GOTREF(__pyx_t_5);
8455  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
8456  __Pyx_GOTREF(__pyx_t_1);
8457  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8458  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8459  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8460  __Pyx_INCREF(__pyx_int_184977713);
8461  __Pyx_GIVEREF(__pyx_int_184977713);
8462  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8463  __Pyx_INCREF(__pyx_v_state);
8464  __Pyx_GIVEREF(__pyx_v_state);
8465  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8466  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
8467  __Pyx_GOTREF(__pyx_t_4);
8468  __Pyx_GIVEREF(__pyx_t_5);
8469  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8470  __Pyx_GIVEREF(__pyx_t_1);
8471  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
8472  __pyx_t_5 = 0;
8473  __pyx_t_1 = 0;
8474  __pyx_r = __pyx_t_4;
8475  __pyx_t_4 = 0;
8476  goto __pyx_L0;
8477  }
8478 
8479  /* "(tree fragment)":1
8480  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8481  * cdef tuple state
8482  * cdef object _dict
8483  */
8484 
8485  /* function exit code */
8486  __pyx_L1_error:;
8487  __Pyx_XDECREF(__pyx_t_1);
8488  __Pyx_XDECREF(__pyx_t_4);
8489  __Pyx_XDECREF(__pyx_t_5);
8490  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8491  __pyx_r = NULL;
8492  __pyx_L0:;
8493  __Pyx_XDECREF(__pyx_v_state);
8494  __Pyx_XDECREF(__pyx_v__dict);
8495  __Pyx_XGIVEREF(__pyx_r);
8496  __Pyx_TraceReturn(__pyx_r, 0);
8497  __Pyx_RefNannyFinishContext();
8498  return __pyx_r;
8499 }
8500 
8501 /* "(tree fragment)":16
8502  * else:
8503  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8504  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8505  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8506  */
8507 
8508 /* Python wrapper */
8509 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8510 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
8511 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8512  PyObject *__pyx_r = 0;
8513  __Pyx_RefNannyDeclarations
8514  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8515  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8516 
8517  /* function exit code */
8518  __Pyx_RefNannyFinishContext();
8519  return __pyx_r;
8520 }
8521 
8522 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8523  PyObject *__pyx_r = NULL;
8524  __Pyx_TraceDeclarations
8525  __Pyx_RefNannyDeclarations
8526  PyObject *__pyx_t_1 = NULL;
8527  int __pyx_lineno = 0;
8528  const char *__pyx_filename = NULL;
8529  int __pyx_clineno = 0;
8530  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8531  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 16, 0, __PYX_ERR(2, 16, __pyx_L1_error));
8532 
8533  /* "(tree fragment)":17
8534  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8535  * def __setstate_cython__(self, __pyx_state):
8536  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
8537  */
8538  __Pyx_TraceLine(17,0,__PYX_ERR(2, 17, __pyx_L1_error))
8539  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
8540  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
8541  __Pyx_GOTREF(__pyx_t_1);
8542  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8543 
8544  /* "(tree fragment)":16
8545  * else:
8546  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8547  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8548  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8549  */
8550 
8551  /* function exit code */
8552  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8553  goto __pyx_L0;
8554  __pyx_L1_error:;
8555  __Pyx_XDECREF(__pyx_t_1);
8556  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8557  __pyx_r = NULL;
8558  __pyx_L0:;
8559  __Pyx_XGIVEREF(__pyx_r);
8560  __Pyx_TraceReturn(__pyx_r, 0);
8561  __Pyx_RefNannyFinishContext();
8562  return __pyx_r;
8563 }
8564 
8565 /* "View.MemoryView":299
8566  *
8567  * @cname('__pyx_align_pointer')
8568  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
8569  * "Align pointer memory on a given boundary"
8570  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8571  */
8572 
8573 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
8574  Py_intptr_t __pyx_v_aligned_p;
8575  size_t __pyx_v_offset;
8576  void *__pyx_r;
8577  __Pyx_TraceDeclarations
8578  int __pyx_t_1;
8579  int __pyx_lineno = 0;
8580  const char *__pyx_filename = NULL;
8581  int __pyx_clineno = 0;
8582  __Pyx_TraceCall("align_pointer", __pyx_f[2], 299, 1, __PYX_ERR(2, 299, __pyx_L1_error));
8583 
8584  /* "View.MemoryView":301
8585  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
8586  * "Align pointer memory on a given boundary"
8587  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
8588  * cdef size_t offset
8589  *
8590  */
8591  __Pyx_TraceLine(301,1,__PYX_ERR(2, 301, __pyx_L1_error))
8592  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8593 
8594  /* "View.MemoryView":305
8595  *
8596  * with cython.cdivision(True):
8597  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
8598  *
8599  * if offset > 0:
8600  */
8601  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8602 
8603  /* "View.MemoryView":307
8604  * offset = aligned_p % alignment
8605  *
8606  * if offset > 0: # <<<<<<<<<<<<<<
8607  * aligned_p += alignment - offset
8608  *
8609  */
8610  __Pyx_TraceLine(307,1,__PYX_ERR(2, 307, __pyx_L1_error))
8611  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8612  if (__pyx_t_1) {
8613 
8614  /* "View.MemoryView":308
8615  *
8616  * if offset > 0:
8617  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
8618  *
8619  * return <void *> aligned_p
8620  */
8621  __Pyx_TraceLine(308,1,__PYX_ERR(2, 308, __pyx_L1_error))
8622  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8623 
8624  /* "View.MemoryView":307
8625  * offset = aligned_p % alignment
8626  *
8627  * if offset > 0: # <<<<<<<<<<<<<<
8628  * aligned_p += alignment - offset
8629  *
8630  */
8631  }
8632 
8633  /* "View.MemoryView":310
8634  * aligned_p += alignment - offset
8635  *
8636  * return <void *> aligned_p # <<<<<<<<<<<<<<
8637  *
8638  *
8639  */
8640  __Pyx_TraceLine(310,1,__PYX_ERR(2, 310, __pyx_L1_error))
8641  __pyx_r = ((void *)__pyx_v_aligned_p);
8642  goto __pyx_L0;
8643 
8644  /* "View.MemoryView":299
8645  *
8646  * @cname('__pyx_align_pointer')
8647  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
8648  * "Align pointer memory on a given boundary"
8649  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8650  */
8651 
8652  /* function exit code */
8653  __pyx_L1_error:;
8654  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
8655  __pyx_r = 0;
8656  __pyx_L0:;
8657  __Pyx_TraceReturn(Py_None, 1);
8658  return __pyx_r;
8659 }
8660 
8661 /* "View.MemoryView":346
8662  * cdef __Pyx_TypeInfo *typeinfo
8663  *
8664  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8665  * self.obj = obj
8666  * self.flags = flags
8667  */
8668 
8669 /* Python wrapper */
8670 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8671 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8672  PyObject *__pyx_v_obj = 0;
8673  int __pyx_v_flags;
8674  int __pyx_v_dtype_is_object;
8675  int __pyx_lineno = 0;
8676  const char *__pyx_filename = NULL;
8677  int __pyx_clineno = 0;
8678  int __pyx_r;
8679  __Pyx_RefNannyDeclarations
8680  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8681  {
8682  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8683  PyObject* values[3] = {0,0,0};
8684  if (unlikely(__pyx_kwds)) {
8685  Py_ssize_t kw_args;
8686  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8687  switch (pos_args) {
8688  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8689  CYTHON_FALLTHROUGH;
8690  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8691  CYTHON_FALLTHROUGH;
8692  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8693  CYTHON_FALLTHROUGH;
8694  case 0: break;
8695  default: goto __pyx_L5_argtuple_error;
8696  }
8697  kw_args = PyDict_Size(__pyx_kwds);
8698  switch (pos_args) {
8699  case 0:
8700  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8701  else goto __pyx_L5_argtuple_error;
8702  CYTHON_FALLTHROUGH;
8703  case 1:
8704  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8705  else {
8706  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 346, __pyx_L3_error)
8707  }
8708  CYTHON_FALLTHROUGH;
8709  case 2:
8710  if (kw_args > 0) {
8711  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8712  if (value) { values[2] = value; kw_args--; }
8713  }
8714  }
8715  if (unlikely(kw_args > 0)) {
8716  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 346, __pyx_L3_error)
8717  }
8718  } else {
8719  switch (PyTuple_GET_SIZE(__pyx_args)) {
8720  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8721  CYTHON_FALLTHROUGH;
8722  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8723  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8724  break;
8725  default: goto __pyx_L5_argtuple_error;
8726  }
8727  }
8728  __pyx_v_obj = values[0];
8729  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error)
8730  if (values[2]) {
8731  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error)
8732  } else {
8733  __pyx_v_dtype_is_object = ((int)0);
8734  }
8735  }
8736  goto __pyx_L4_argument_unpacking_done;
8737  __pyx_L5_argtuple_error:;
8738  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 346, __pyx_L3_error)
8739  __pyx_L3_error:;
8740  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8741  __Pyx_RefNannyFinishContext();
8742  return -1;
8743  __pyx_L4_argument_unpacking_done:;
8744  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
8745 
8746  /* function exit code */
8747  __Pyx_RefNannyFinishContext();
8748  return __pyx_r;
8749 }
8750 
8751 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
8752  int __pyx_r;
8753  __Pyx_TraceDeclarations
8754  __Pyx_RefNannyDeclarations
8755  int __pyx_t_1;
8756  int __pyx_t_2;
8757  int __pyx_t_3;
8758  int __pyx_t_4;
8759  int __pyx_lineno = 0;
8760  const char *__pyx_filename = NULL;
8761  int __pyx_clineno = 0;
8762  __Pyx_RefNannySetupContext("__cinit__", 0);
8763  __Pyx_TraceCall("__cinit__", __pyx_f[2], 346, 0, __PYX_ERR(2, 346, __pyx_L1_error));
8764 
8765  /* "View.MemoryView":347
8766  *
8767  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8768  * self.obj = obj # <<<<<<<<<<<<<<
8769  * self.flags = flags
8770  * if type(self) is memoryview or obj is not None:
8771  */
8772  __Pyx_TraceLine(347,0,__PYX_ERR(2, 347, __pyx_L1_error))
8773  __Pyx_INCREF(__pyx_v_obj);
8774  __Pyx_GIVEREF(__pyx_v_obj);
8775  __Pyx_GOTREF(__pyx_v_self->obj);
8776  __Pyx_DECREF(__pyx_v_self->obj);
8777  __pyx_v_self->obj = __pyx_v_obj;
8778 
8779  /* "View.MemoryView":348
8780  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8781  * self.obj = obj
8782  * self.flags = flags # <<<<<<<<<<<<<<
8783  * if type(self) is memoryview or obj is not None:
8784  * __Pyx_GetBuffer(obj, &self.view, flags)
8785  */
8786  __Pyx_TraceLine(348,0,__PYX_ERR(2, 348, __pyx_L1_error))
8787  __pyx_v_self->flags = __pyx_v_flags;
8788 
8789  /* "View.MemoryView":349
8790  * self.obj = obj
8791  * self.flags = flags
8792  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8793  * __Pyx_GetBuffer(obj, &self.view, flags)
8794  * if <PyObject *> self.view.obj == NULL:
8795  */
8796  __Pyx_TraceLine(349,0,__PYX_ERR(2, 349, __pyx_L1_error))
8797  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8798  __pyx_t_3 = (__pyx_t_2 != 0);
8799  if (!__pyx_t_3) {
8800  } else {
8801  __pyx_t_1 = __pyx_t_3;
8802  goto __pyx_L4_bool_binop_done;
8803  }
8804  __pyx_t_3 = (__pyx_v_obj != Py_None);
8805  __pyx_t_2 = (__pyx_t_3 != 0);
8806  __pyx_t_1 = __pyx_t_2;
8807  __pyx_L4_bool_binop_done:;
8808  if (__pyx_t_1) {
8809 
8810  /* "View.MemoryView":350
8811  * self.flags = flags
8812  * if type(self) is memoryview or obj is not None:
8813  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
8814  * if <PyObject *> self.view.obj == NULL:
8815  * (<__pyx_buffer *> &self.view).obj = Py_None
8816  */
8817  __Pyx_TraceLine(350,0,__PYX_ERR(2, 350, __pyx_L1_error))
8818  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 350, __pyx_L1_error)
8819 
8820  /* "View.MemoryView":351
8821  * if type(self) is memoryview or obj is not None:
8822  * __Pyx_GetBuffer(obj, &self.view, flags)
8823  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8824  * (<__pyx_buffer *> &self.view).obj = Py_None
8825  * Py_INCREF(Py_None)
8826  */
8827  __Pyx_TraceLine(351,0,__PYX_ERR(2, 351, __pyx_L1_error))
8828  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
8829  if (__pyx_t_1) {
8830 
8831  /* "View.MemoryView":352
8832  * __Pyx_GetBuffer(obj, &self.view, flags)
8833  * if <PyObject *> self.view.obj == NULL:
8834  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
8835  * Py_INCREF(Py_None)
8836  *
8837  */
8838  __Pyx_TraceLine(352,0,__PYX_ERR(2, 352, __pyx_L1_error))
8839  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8840 
8841  /* "View.MemoryView":353
8842  * if <PyObject *> self.view.obj == NULL:
8843  * (<__pyx_buffer *> &self.view).obj = Py_None
8844  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8845  *
8846  * if not __PYX_CYTHON_ATOMICS_ENABLED():
8847  */
8848  __Pyx_TraceLine(353,0,__PYX_ERR(2, 353, __pyx_L1_error))
8849  Py_INCREF(Py_None);
8850 
8851  /* "View.MemoryView":351
8852  * if type(self) is memoryview or obj is not None:
8853  * __Pyx_GetBuffer(obj, &self.view, flags)
8854  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8855  * (<__pyx_buffer *> &self.view).obj = Py_None
8856  * Py_INCREF(Py_None)
8857  */
8858  }
8859 
8860  /* "View.MemoryView":349
8861  * self.obj = obj
8862  * self.flags = flags
8863  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8864  * __Pyx_GetBuffer(obj, &self.view, flags)
8865  * if <PyObject *> self.view.obj == NULL:
8866  */
8867  }
8868 
8869  /* "View.MemoryView":355
8870  * Py_INCREF(Py_None)
8871  *
8872  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8873  * global __pyx_memoryview_thread_locks_used
8874  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8875  */
8876  __Pyx_TraceLine(355,0,__PYX_ERR(2, 355, __pyx_L1_error))
8877  __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
8878  if (__pyx_t_1) {
8879 
8880  /* "View.MemoryView":357
8881  * if not __PYX_CYTHON_ATOMICS_ENABLED():
8882  * global __pyx_memoryview_thread_locks_used
8883  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
8884  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8885  * __pyx_memoryview_thread_locks_used += 1
8886  */
8887  __Pyx_TraceLine(357,0,__PYX_ERR(2, 357, __pyx_L1_error))
8888  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
8889  if (__pyx_t_1) {
8890 
8891  /* "View.MemoryView":358
8892  * global __pyx_memoryview_thread_locks_used
8893  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8894  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
8895  * __pyx_memoryview_thread_locks_used += 1
8896  * if self.lock is NULL:
8897  */
8898  __Pyx_TraceLine(358,0,__PYX_ERR(2, 358, __pyx_L1_error))
8899  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8900 
8901  /* "View.MemoryView":359
8902  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8903  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8904  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
8905  * if self.lock is NULL:
8906  * self.lock = PyThread_allocate_lock()
8907  */
8908  __Pyx_TraceLine(359,0,__PYX_ERR(2, 359, __pyx_L1_error))
8909  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8910 
8911  /* "View.MemoryView":357
8912  * if not __PYX_CYTHON_ATOMICS_ENABLED():
8913  * global __pyx_memoryview_thread_locks_used
8914  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
8915  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8916  * __pyx_memoryview_thread_locks_used += 1
8917  */
8918  }
8919 
8920  /* "View.MemoryView":360
8921  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8922  * __pyx_memoryview_thread_locks_used += 1
8923  * if self.lock is NULL: # <<<<<<<<<<<<<<
8924  * self.lock = PyThread_allocate_lock()
8925  * if self.lock is NULL:
8926  */
8927  __Pyx_TraceLine(360,0,__PYX_ERR(2, 360, __pyx_L1_error))
8928  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8929  if (__pyx_t_1) {
8930 
8931  /* "View.MemoryView":361
8932  * __pyx_memoryview_thread_locks_used += 1
8933  * if self.lock is NULL:
8934  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
8935  * if self.lock is NULL:
8936  * raise MemoryError
8937  */
8938  __Pyx_TraceLine(361,0,__PYX_ERR(2, 361, __pyx_L1_error))
8939  __pyx_v_self->lock = PyThread_allocate_lock();
8940 
8941  /* "View.MemoryView":362
8942  * if self.lock is NULL:
8943  * self.lock = PyThread_allocate_lock()
8944  * if self.lock is NULL: # <<<<<<<<<<<<<<
8945  * raise MemoryError
8946  *
8947  */
8948  __Pyx_TraceLine(362,0,__PYX_ERR(2, 362, __pyx_L1_error))
8949  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8950  if (unlikely(__pyx_t_1)) {
8951 
8952  /* "View.MemoryView":363
8953  * self.lock = PyThread_allocate_lock()
8954  * if self.lock is NULL:
8955  * raise MemoryError # <<<<<<<<<<<<<<
8956  *
8957  * if flags & PyBUF_FORMAT:
8958  */
8959  __Pyx_TraceLine(363,0,__PYX_ERR(2, 363, __pyx_L1_error))
8960  PyErr_NoMemory(); __PYX_ERR(2, 363, __pyx_L1_error)
8961 
8962  /* "View.MemoryView":362
8963  * if self.lock is NULL:
8964  * self.lock = PyThread_allocate_lock()
8965  * if self.lock is NULL: # <<<<<<<<<<<<<<
8966  * raise MemoryError
8967  *
8968  */
8969  }
8970 
8971  /* "View.MemoryView":360
8972  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8973  * __pyx_memoryview_thread_locks_used += 1
8974  * if self.lock is NULL: # <<<<<<<<<<<<<<
8975  * self.lock = PyThread_allocate_lock()
8976  * if self.lock is NULL:
8977  */
8978  }
8979 
8980  /* "View.MemoryView":355
8981  * Py_INCREF(Py_None)
8982  *
8983  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8984  * global __pyx_memoryview_thread_locks_used
8985  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8986  */
8987  }
8988 
8989  /* "View.MemoryView":365
8990  * raise MemoryError
8991  *
8992  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8993  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8994  * else:
8995  */
8996  __Pyx_TraceLine(365,0,__PYX_ERR(2, 365, __pyx_L1_error))
8997  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8998  if (__pyx_t_1) {
8999 
9000  /* "View.MemoryView":366
9001  *
9002  * if flags & PyBUF_FORMAT:
9003  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
9004  * else:
9005  * self.dtype_is_object = dtype_is_object
9006  */
9007  __Pyx_TraceLine(366,0,__PYX_ERR(2, 366, __pyx_L1_error))
9008  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
9009  if (__pyx_t_2) {
9010  } else {
9011  __pyx_t_1 = __pyx_t_2;
9012  goto __pyx_L12_bool_binop_done;
9013  }
9014  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
9015  __pyx_t_1 = __pyx_t_2;
9016  __pyx_L12_bool_binop_done:;
9017  __pyx_v_self->dtype_is_object = __pyx_t_1;
9018 
9019  /* "View.MemoryView":365
9020  * raise MemoryError
9021  *
9022  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9023  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9024  * else:
9025  */
9026  goto __pyx_L11;
9027  }
9028 
9029  /* "View.MemoryView":368
9030  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9031  * else:
9032  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
9033  *
9034  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9035  */
9036  __Pyx_TraceLine(368,0,__PYX_ERR(2, 368, __pyx_L1_error))
9037  /*else*/ {
9038  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9039  }
9040  __pyx_L11:;
9041 
9042  /* "View.MemoryView":370
9043  * self.dtype_is_object = dtype_is_object
9044  *
9045  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
9046  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9047  * self.typeinfo = NULL
9048  */
9049  __Pyx_TraceLine(370,0,__PYX_ERR(2, 370, __pyx_L1_error))
9050  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
9051 
9052  /* "View.MemoryView":372
9053  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9054  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9055  * self.typeinfo = NULL # <<<<<<<<<<<<<<
9056  *
9057  * def __dealloc__(memoryview self):
9058  */
9059  __Pyx_TraceLine(372,0,__PYX_ERR(2, 372, __pyx_L1_error))
9060  __pyx_v_self->typeinfo = NULL;
9061 
9062  /* "View.MemoryView":346
9063  * cdef __Pyx_TypeInfo *typeinfo
9064  *
9065  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9066  * self.obj = obj
9067  * self.flags = flags
9068  */
9069 
9070  /* function exit code */
9071  __pyx_r = 0;
9072  goto __pyx_L0;
9073  __pyx_L1_error:;
9074  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9075  __pyx_r = -1;
9076  __pyx_L0:;
9077  __Pyx_TraceReturn(Py_None, 0);
9078  __Pyx_RefNannyFinishContext();
9079  return __pyx_r;
9080 }
9081 
9082 /* "View.MemoryView":374
9083  * self.typeinfo = NULL
9084  *
9085  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9086  * if self.obj is not None:
9087  * __Pyx_ReleaseBuffer(&self.view)
9088  */
9089 
9090 /* Python wrapper */
9091 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
9092 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9093  __Pyx_RefNannyDeclarations
9094  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9095  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
9096 
9097  /* function exit code */
9098  __Pyx_RefNannyFinishContext();
9099 }
9100 
9101 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
9102  int __pyx_v_i;
9103  __Pyx_TraceDeclarations
9104  __Pyx_RefNannyDeclarations
9105  int __pyx_t_1;
9106  int __pyx_t_2;
9107  int __pyx_t_3;
9108  int __pyx_t_4;
9109  int __pyx_t_5;
9110  PyThread_type_lock __pyx_t_6;
9111  PyThread_type_lock __pyx_t_7;
9112  int __pyx_lineno = 0;
9113  const char *__pyx_filename = NULL;
9114  int __pyx_clineno = 0;
9115  __Pyx_RefNannySetupContext("__dealloc__", 0);
9116  __Pyx_TraceCall("__dealloc__", __pyx_f[2], 374, 0, __PYX_ERR(2, 374, __pyx_L1_error));
9117 
9118  /* "View.MemoryView":375
9119  *
9120  * def __dealloc__(memoryview self):
9121  * if self.obj is not None: # <<<<<<<<<<<<<<
9122  * __Pyx_ReleaseBuffer(&self.view)
9123  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9124  */
9125  __Pyx_TraceLine(375,0,__PYX_ERR(2, 375, __pyx_L1_error))
9126  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9127  __pyx_t_2 = (__pyx_t_1 != 0);
9128  if (__pyx_t_2) {
9129 
9130  /* "View.MemoryView":376
9131  * def __dealloc__(memoryview self):
9132  * if self.obj is not None:
9133  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
9134  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9135  *
9136  */
9137  __Pyx_TraceLine(376,0,__PYX_ERR(2, 376, __pyx_L1_error))
9138  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9139 
9140  /* "View.MemoryView":375
9141  *
9142  * def __dealloc__(memoryview self):
9143  * if self.obj is not None: # <<<<<<<<<<<<<<
9144  * __Pyx_ReleaseBuffer(&self.view)
9145  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9146  */
9147  goto __pyx_L3;
9148  }
9149 
9150  /* "View.MemoryView":377
9151  * if self.obj is not None:
9152  * __Pyx_ReleaseBuffer(&self.view)
9153  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9154  *
9155  * (<__pyx_buffer *> &self.view).obj = NULL
9156  */
9157  __Pyx_TraceLine(377,0,__PYX_ERR(2, 377, __pyx_L1_error))
9158  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9159  if (__pyx_t_2) {
9160 
9161  /* "View.MemoryView":379
9162  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9163  *
9164  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
9165  * Py_DECREF(Py_None)
9166  *
9167  */
9168  __Pyx_TraceLine(379,0,__PYX_ERR(2, 379, __pyx_L1_error))
9169  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9170 
9171  /* "View.MemoryView":380
9172  *
9173  * (<__pyx_buffer *> &self.view).obj = NULL
9174  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
9175  *
9176  * cdef int i
9177  */
9178  __Pyx_TraceLine(380,0,__PYX_ERR(2, 380, __pyx_L1_error))
9179  Py_DECREF(Py_None);
9180 
9181  /* "View.MemoryView":377
9182  * if self.obj is not None:
9183  * __Pyx_ReleaseBuffer(&self.view)
9184  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9185  *
9186  * (<__pyx_buffer *> &self.view).obj = NULL
9187  */
9188  }
9189  __pyx_L3:;
9190 
9191  /* "View.MemoryView":384
9192  * cdef int i
9193  * global __pyx_memoryview_thread_locks_used
9194  * if self.lock != NULL: # <<<<<<<<<<<<<<
9195  * for i in range(__pyx_memoryview_thread_locks_used):
9196  * if __pyx_memoryview_thread_locks[i] is self.lock:
9197  */
9198  __Pyx_TraceLine(384,0,__PYX_ERR(2, 384, __pyx_L1_error))
9199  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9200  if (__pyx_t_2) {
9201 
9202  /* "View.MemoryView":385
9203  * global __pyx_memoryview_thread_locks_used
9204  * if self.lock != NULL:
9205  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
9206  * if __pyx_memoryview_thread_locks[i] is self.lock:
9207  * __pyx_memoryview_thread_locks_used -= 1
9208  */
9209  __Pyx_TraceLine(385,0,__PYX_ERR(2, 385, __pyx_L1_error))
9210  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9211  __pyx_t_4 = __pyx_t_3;
9212  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9213  __pyx_v_i = __pyx_t_5;
9214 
9215  /* "View.MemoryView":386
9216  * if self.lock != NULL:
9217  * for i in range(__pyx_memoryview_thread_locks_used):
9218  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9219  * __pyx_memoryview_thread_locks_used -= 1
9220  * if i != __pyx_memoryview_thread_locks_used:
9221  */
9222  __Pyx_TraceLine(386,0,__PYX_ERR(2, 386, __pyx_L1_error))
9223  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9224  if (__pyx_t_2) {
9225 
9226  /* "View.MemoryView":387
9227  * for i in range(__pyx_memoryview_thread_locks_used):
9228  * if __pyx_memoryview_thread_locks[i] is self.lock:
9229  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
9230  * if i != __pyx_memoryview_thread_locks_used:
9231  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9232  */
9233  __Pyx_TraceLine(387,0,__PYX_ERR(2, 387, __pyx_L1_error))
9234  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9235 
9236  /* "View.MemoryView":388
9237  * if __pyx_memoryview_thread_locks[i] is self.lock:
9238  * __pyx_memoryview_thread_locks_used -= 1
9239  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9240  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9241  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9242  */
9243  __Pyx_TraceLine(388,0,__PYX_ERR(2, 388, __pyx_L1_error))
9244  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9245  if (__pyx_t_2) {
9246 
9247  /* "View.MemoryView":390
9248  * if i != __pyx_memoryview_thread_locks_used:
9249  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9250  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
9251  * break
9252  * else:
9253  */
9254  __Pyx_TraceLine(390,0,__PYX_ERR(2, 390, __pyx_L1_error))
9255  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9256  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9257 
9258  /* "View.MemoryView":389
9259  * __pyx_memoryview_thread_locks_used -= 1
9260  * if i != __pyx_memoryview_thread_locks_used:
9261  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
9262  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9263  * break
9264  */
9265  __Pyx_TraceLine(389,0,__PYX_ERR(2, 389, __pyx_L1_error))
9266  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9267  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9268 
9269  /* "View.MemoryView":388
9270  * if __pyx_memoryview_thread_locks[i] is self.lock:
9271  * __pyx_memoryview_thread_locks_used -= 1
9272  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9273  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9274  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9275  */
9276  }
9277 
9278  /* "View.MemoryView":391
9279  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9280  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9281  * break # <<<<<<<<<<<<<<
9282  * else:
9283  * PyThread_free_lock(self.lock)
9284  */
9285  __Pyx_TraceLine(391,0,__PYX_ERR(2, 391, __pyx_L1_error))
9286  goto __pyx_L6_break;
9287 
9288  /* "View.MemoryView":386
9289  * if self.lock != NULL:
9290  * for i in range(__pyx_memoryview_thread_locks_used):
9291  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9292  * __pyx_memoryview_thread_locks_used -= 1
9293  * if i != __pyx_memoryview_thread_locks_used:
9294  */
9295  }
9296  }
9297  /*else*/ {
9298 
9299  /* "View.MemoryView":393
9300  * break
9301  * else:
9302  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
9303  *
9304  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9305  */
9306  __Pyx_TraceLine(393,0,__PYX_ERR(2, 393, __pyx_L1_error))
9307  PyThread_free_lock(__pyx_v_self->lock);
9308  }
9309  __pyx_L6_break:;
9310 
9311  /* "View.MemoryView":384
9312  * cdef int i
9313  * global __pyx_memoryview_thread_locks_used
9314  * if self.lock != NULL: # <<<<<<<<<<<<<<
9315  * for i in range(__pyx_memoryview_thread_locks_used):
9316  * if __pyx_memoryview_thread_locks[i] is self.lock:
9317  */
9318  }
9319 
9320  /* "View.MemoryView":374
9321  * self.typeinfo = NULL
9322  *
9323  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9324  * if self.obj is not None:
9325  * __Pyx_ReleaseBuffer(&self.view)
9326  */
9327 
9328  /* function exit code */
9329  goto __pyx_L0;
9330  __pyx_L1_error:;
9331  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9332  __pyx_L0:;
9333  __Pyx_TraceReturn(Py_None, 0);
9334  __Pyx_RefNannyFinishContext();
9335 }
9336 
9337 /* "View.MemoryView":395
9338  * PyThread_free_lock(self.lock)
9339  *
9340  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9341  * cdef Py_ssize_t dim
9342  * cdef char *itemp = <char *> self.view.buf
9343  */
9344 
9345 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9346  Py_ssize_t __pyx_v_dim;
9347  char *__pyx_v_itemp;
9348  PyObject *__pyx_v_idx = NULL;
9349  char *__pyx_r;
9350  __Pyx_TraceDeclarations
9351  __Pyx_RefNannyDeclarations
9352  Py_ssize_t __pyx_t_1;
9353  PyObject *__pyx_t_2 = NULL;
9354  Py_ssize_t __pyx_t_3;
9355  PyObject *(*__pyx_t_4)(PyObject *);
9356  PyObject *__pyx_t_5 = NULL;
9357  Py_ssize_t __pyx_t_6;
9358  char *__pyx_t_7;
9359  int __pyx_lineno = 0;
9360  const char *__pyx_filename = NULL;
9361  int __pyx_clineno = 0;
9362  __Pyx_RefNannySetupContext("get_item_pointer", 0);
9363  __Pyx_TraceCall("get_item_pointer", __pyx_f[2], 395, 0, __PYX_ERR(2, 395, __pyx_L1_error));
9364 
9365  /* "View.MemoryView":397
9366  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9367  * cdef Py_ssize_t dim
9368  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
9369  *
9370  * for dim, idx in enumerate(index):
9371  */
9372  __Pyx_TraceLine(397,0,__PYX_ERR(2, 397, __pyx_L1_error))
9373  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
9374 
9375  /* "View.MemoryView":399
9376  * cdef char *itemp = <char *> self.view.buf
9377  *
9378  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9379  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9380  *
9381  */
9382  __Pyx_TraceLine(399,0,__PYX_ERR(2, 399, __pyx_L1_error))
9383  __pyx_t_1 = 0;
9384  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9385  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9386  __pyx_t_4 = NULL;
9387  } else {
9388  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 399, __pyx_L1_error)
9389  __Pyx_GOTREF(__pyx_t_2);
9390  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error)
9391  }
9392  for (;;) {
9393  if (likely(!__pyx_t_4)) {
9394  if (likely(PyList_CheckExact(__pyx_t_2))) {
9395  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
9396  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9397  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error)
9398  #else
9399  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
9400  __Pyx_GOTREF(__pyx_t_5);
9401  #endif
9402  } else {
9403  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9404  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9405  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error)
9406  #else
9407  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
9408  __Pyx_GOTREF(__pyx_t_5);
9409  #endif
9410  }
9411  } else {
9412  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9413  if (unlikely(!__pyx_t_5)) {
9414  PyObject* exc_type = PyErr_Occurred();
9415  if (exc_type) {
9416  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9417  else __PYX_ERR(2, 399, __pyx_L1_error)
9418  }
9419  break;
9420  }
9421  __Pyx_GOTREF(__pyx_t_5);
9422  }
9423  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9424  __pyx_t_5 = 0;
9425  __pyx_v_dim = __pyx_t_1;
9426  __pyx_t_1 = (__pyx_t_1 + 1);
9427 
9428  /* "View.MemoryView":400
9429  *
9430  * for dim, idx in enumerate(index):
9431  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
9432  *
9433  * return itemp
9434  */
9435  __Pyx_TraceLine(400,0,__PYX_ERR(2, 400, __pyx_L1_error))
9436  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 400, __pyx_L1_error)
9437  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 400, __pyx_L1_error)
9438  __pyx_v_itemp = __pyx_t_7;
9439 
9440  /* "View.MemoryView":399
9441  * cdef char *itemp = <char *> self.view.buf
9442  *
9443  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9444  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9445  *
9446  */
9447  __Pyx_TraceLine(399,0,__PYX_ERR(2, 399, __pyx_L1_error))
9448  }
9449  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9450 
9451  /* "View.MemoryView":402
9452  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9453  *
9454  * return itemp # <<<<<<<<<<<<<<
9455  *
9456  *
9457  */
9458  __Pyx_TraceLine(402,0,__PYX_ERR(2, 402, __pyx_L1_error))
9459  __pyx_r = __pyx_v_itemp;
9460  goto __pyx_L0;
9461 
9462  /* "View.MemoryView":395
9463  * PyThread_free_lock(self.lock)
9464  *
9465  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9466  * cdef Py_ssize_t dim
9467  * cdef char *itemp = <char *> self.view.buf
9468  */
9469 
9470  /* function exit code */
9471  __pyx_L1_error:;
9472  __Pyx_XDECREF(__pyx_t_2);
9473  __Pyx_XDECREF(__pyx_t_5);
9474  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9475  __pyx_r = NULL;
9476  __pyx_L0:;
9477  __Pyx_XDECREF(__pyx_v_idx);
9478  __Pyx_TraceReturn(Py_None, 0);
9479  __Pyx_RefNannyFinishContext();
9480  return __pyx_r;
9481 }
9482 
9483 /* "View.MemoryView":405
9484  *
9485  *
9486  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9487  * if index is Ellipsis:
9488  * return self
9489  */
9490 
9491 /* Python wrapper */
9492 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
9493 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9494  PyObject *__pyx_r = 0;
9495  __Pyx_RefNannyDeclarations
9496  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9497  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9498 
9499  /* function exit code */
9500  __Pyx_RefNannyFinishContext();
9501  return __pyx_r;
9502 }
9503 
9504 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9505  PyObject *__pyx_v_have_slices = NULL;
9506  PyObject *__pyx_v_indices = NULL;
9507  char *__pyx_v_itemp;
9508  PyObject *__pyx_r = NULL;
9509  __Pyx_TraceDeclarations
9510  __Pyx_RefNannyDeclarations
9511  int __pyx_t_1;
9512  int __pyx_t_2;
9513  PyObject *__pyx_t_3 = NULL;
9514  PyObject *__pyx_t_4 = NULL;
9515  PyObject *__pyx_t_5 = NULL;
9516  char *__pyx_t_6;
9517  int __pyx_lineno = 0;
9518  const char *__pyx_filename = NULL;
9519  int __pyx_clineno = 0;
9520  __Pyx_RefNannySetupContext("__getitem__", 0);
9521  __Pyx_TraceCall("__getitem__", __pyx_f[2], 405, 0, __PYX_ERR(2, 405, __pyx_L1_error));
9522 
9523  /* "View.MemoryView":406
9524  *
9525  * def __getitem__(memoryview self, object index):
9526  * if index is Ellipsis: # <<<<<<<<<<<<<<
9527  * return self
9528  *
9529  */
9530  __Pyx_TraceLine(406,0,__PYX_ERR(2, 406, __pyx_L1_error))
9531  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9532  __pyx_t_2 = (__pyx_t_1 != 0);
9533  if (__pyx_t_2) {
9534 
9535  /* "View.MemoryView":407
9536  * def __getitem__(memoryview self, object index):
9537  * if index is Ellipsis:
9538  * return self # <<<<<<<<<<<<<<
9539  *
9540  * have_slices, indices = _unellipsify(index, self.view.ndim)
9541  */
9542  __Pyx_TraceLine(407,0,__PYX_ERR(2, 407, __pyx_L1_error))
9543  __Pyx_XDECREF(__pyx_r);
9544  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9545  __pyx_r = ((PyObject *)__pyx_v_self);
9546  goto __pyx_L0;
9547 
9548  /* "View.MemoryView":406
9549  *
9550  * def __getitem__(memoryview self, object index):
9551  * if index is Ellipsis: # <<<<<<<<<<<<<<
9552  * return self
9553  *
9554  */
9555  }
9556 
9557  /* "View.MemoryView":409
9558  * return self
9559  *
9560  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9561  *
9562  * cdef char *itemp
9563  */
9564  __Pyx_TraceLine(409,0,__PYX_ERR(2, 409, __pyx_L1_error))
9565  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error)
9566  __Pyx_GOTREF(__pyx_t_3);
9567  if (likely(__pyx_t_3 != Py_None)) {
9568  PyObject* sequence = __pyx_t_3;
9569  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9570  if (unlikely(size != 2)) {
9571  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9572  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9573  __PYX_ERR(2, 409, __pyx_L1_error)
9574  }
9575  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9576  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9577  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9578  __Pyx_INCREF(__pyx_t_4);
9579  __Pyx_INCREF(__pyx_t_5);
9580  #else
9581  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 409, __pyx_L1_error)
9582  __Pyx_GOTREF(__pyx_t_4);
9583  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 409, __pyx_L1_error)
9584  __Pyx_GOTREF(__pyx_t_5);
9585  #endif
9586  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9587  } else {
9588  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error)
9589  }
9590  __pyx_v_have_slices = __pyx_t_4;
9591  __pyx_t_4 = 0;
9592  __pyx_v_indices = __pyx_t_5;
9593  __pyx_t_5 = 0;
9594 
9595  /* "View.MemoryView":412
9596  *
9597  * cdef char *itemp
9598  * if have_slices: # <<<<<<<<<<<<<<
9599  * return memview_slice(self, indices)
9600  * else:
9601  */
9602  __Pyx_TraceLine(412,0,__PYX_ERR(2, 412, __pyx_L1_error))
9603  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 412, __pyx_L1_error)
9604  if (__pyx_t_2) {
9605 
9606  /* "View.MemoryView":413
9607  * cdef char *itemp
9608  * if have_slices:
9609  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
9610  * else:
9611  * itemp = self.get_item_pointer(indices)
9612  */
9613  __Pyx_TraceLine(413,0,__PYX_ERR(2, 413, __pyx_L1_error))
9614  __Pyx_XDECREF(__pyx_r);
9615  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error)
9616  __Pyx_GOTREF(__pyx_t_3);
9617  __pyx_r = __pyx_t_3;
9618  __pyx_t_3 = 0;
9619  goto __pyx_L0;
9620 
9621  /* "View.MemoryView":412
9622  *
9623  * cdef char *itemp
9624  * if have_slices: # <<<<<<<<<<<<<<
9625  * return memview_slice(self, indices)
9626  * else:
9627  */
9628  }
9629 
9630  /* "View.MemoryView":415
9631  * return memview_slice(self, indices)
9632  * else:
9633  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
9634  * return self.convert_item_to_object(itemp)
9635  *
9636  */
9637  __Pyx_TraceLine(415,0,__PYX_ERR(2, 415, __pyx_L1_error))
9638  /*else*/ {
9639  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 415, __pyx_L1_error)
9640  __pyx_v_itemp = __pyx_t_6;
9641 
9642  /* "View.MemoryView":416
9643  * else:
9644  * itemp = self.get_item_pointer(indices)
9645  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
9646  *
9647  * def __setitem__(memoryview self, object index, object value):
9648  */
9649  __Pyx_TraceLine(416,0,__PYX_ERR(2, 416, __pyx_L1_error))
9650  __Pyx_XDECREF(__pyx_r);
9651  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error)
9652  __Pyx_GOTREF(__pyx_t_3);
9653  __pyx_r = __pyx_t_3;
9654  __pyx_t_3 = 0;
9655  goto __pyx_L0;
9656  }
9657 
9658  /* "View.MemoryView":405
9659  *
9660  *
9661  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9662  * if index is Ellipsis:
9663  * return self
9664  */
9665 
9666  /* function exit code */
9667  __pyx_L1_error:;
9668  __Pyx_XDECREF(__pyx_t_3);
9669  __Pyx_XDECREF(__pyx_t_4);
9670  __Pyx_XDECREF(__pyx_t_5);
9671  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9672  __pyx_r = NULL;
9673  __pyx_L0:;
9674  __Pyx_XDECREF(__pyx_v_have_slices);
9675  __Pyx_XDECREF(__pyx_v_indices);
9676  __Pyx_XGIVEREF(__pyx_r);
9677  __Pyx_TraceReturn(__pyx_r, 0);
9678  __Pyx_RefNannyFinishContext();
9679  return __pyx_r;
9680 }
9681 
9682 /* "View.MemoryView":418
9683  * return self.convert_item_to_object(itemp)
9684  *
9685  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9686  * if self.view.readonly:
9687  * raise TypeError("Cannot assign to read-only memoryview")
9688  */
9689 
9690 /* Python wrapper */
9691 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
9692 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9693  int __pyx_r;
9694  __Pyx_RefNannyDeclarations
9695  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9696  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9697 
9698  /* function exit code */
9699  __Pyx_RefNannyFinishContext();
9700  return __pyx_r;
9701 }
9702 
9703 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9704  PyObject *__pyx_v_have_slices = NULL;
9705  PyObject *__pyx_v_obj = NULL;
9706  int __pyx_r;
9707  __Pyx_TraceDeclarations
9708  __Pyx_RefNannyDeclarations
9709  int __pyx_t_1;
9710  PyObject *__pyx_t_2 = NULL;
9711  PyObject *__pyx_t_3 = NULL;
9712  PyObject *__pyx_t_4 = NULL;
9713  int __pyx_lineno = 0;
9714  const char *__pyx_filename = NULL;
9715  int __pyx_clineno = 0;
9716  __Pyx_RefNannySetupContext("__setitem__", 0);
9717  __Pyx_TraceCall("__setitem__", __pyx_f[2], 418, 0, __PYX_ERR(2, 418, __pyx_L1_error));
9718  __Pyx_INCREF(__pyx_v_index);
9719 
9720  /* "View.MemoryView":419
9721  *
9722  * def __setitem__(memoryview self, object index, object value):
9723  * if self.view.readonly: # <<<<<<<<<<<<<<
9724  * raise TypeError("Cannot assign to read-only memoryview")
9725  *
9726  */
9727  __Pyx_TraceLine(419,0,__PYX_ERR(2, 419, __pyx_L1_error))
9728  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9729  if (unlikely(__pyx_t_1)) {
9730 
9731  /* "View.MemoryView":420
9732  * def __setitem__(memoryview self, object index, object value):
9733  * if self.view.readonly:
9734  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
9735  *
9736  * have_slices, index = _unellipsify(index, self.view.ndim)
9737  */
9738  __Pyx_TraceLine(420,0,__PYX_ERR(2, 420, __pyx_L1_error))
9739  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
9740  __Pyx_GOTREF(__pyx_t_2);
9741  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9742  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9743  __PYX_ERR(2, 420, __pyx_L1_error)
9744 
9745  /* "View.MemoryView":419
9746  *
9747  * def __setitem__(memoryview self, object index, object value):
9748  * if self.view.readonly: # <<<<<<<<<<<<<<
9749  * raise TypeError("Cannot assign to read-only memoryview")
9750  *
9751  */
9752  }
9753 
9754  /* "View.MemoryView":422
9755  * raise TypeError("Cannot assign to read-only memoryview")
9756  *
9757  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9758  *
9759  * if have_slices:
9760  */
9761  __Pyx_TraceLine(422,0,__PYX_ERR(2, 422, __pyx_L1_error))
9762  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error)
9763  __Pyx_GOTREF(__pyx_t_2);
9764  if (likely(__pyx_t_2 != Py_None)) {
9765  PyObject* sequence = __pyx_t_2;
9766  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9767  if (unlikely(size != 2)) {
9768  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9769  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9770  __PYX_ERR(2, 422, __pyx_L1_error)
9771  }
9772  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9773  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9774  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9775  __Pyx_INCREF(__pyx_t_3);
9776  __Pyx_INCREF(__pyx_t_4);
9777  #else
9778  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 422, __pyx_L1_error)
9779  __Pyx_GOTREF(__pyx_t_3);
9780  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error)
9781  __Pyx_GOTREF(__pyx_t_4);
9782  #endif
9783  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9784  } else {
9785  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 422, __pyx_L1_error)
9786  }
9787  __pyx_v_have_slices = __pyx_t_3;
9788  __pyx_t_3 = 0;
9789  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
9790  __pyx_t_4 = 0;
9791 
9792  /* "View.MemoryView":424
9793  * have_slices, index = _unellipsify(index, self.view.ndim)
9794  *
9795  * if have_slices: # <<<<<<<<<<<<<<
9796  * obj = self.is_slice(value)
9797  * if obj:
9798  */
9799  __Pyx_TraceLine(424,0,__PYX_ERR(2, 424, __pyx_L1_error))
9800  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
9801  if (__pyx_t_1) {
9802 
9803  /* "View.MemoryView":425
9804  *
9805  * if have_slices:
9806  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
9807  * if obj:
9808  * self.setitem_slice_assignment(self[index], obj)
9809  */
9810  __Pyx_TraceLine(425,0,__PYX_ERR(2, 425, __pyx_L1_error))
9811  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
9812  __Pyx_GOTREF(__pyx_t_2);
9813  __pyx_v_obj = __pyx_t_2;
9814  __pyx_t_2 = 0;
9815 
9816  /* "View.MemoryView":426
9817  * if have_slices:
9818  * obj = self.is_slice(value)
9819  * if obj: # <<<<<<<<<<<<<<
9820  * self.setitem_slice_assignment(self[index], obj)
9821  * else:
9822  */
9823  __Pyx_TraceLine(426,0,__PYX_ERR(2, 426, __pyx_L1_error))
9824  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 426, __pyx_L1_error)
9825  if (__pyx_t_1) {
9826 
9827  /* "View.MemoryView":427
9828  * obj = self.is_slice(value)
9829  * if obj:
9830  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
9831  * else:
9832  * self.setitem_slice_assign_scalar(self[index], value)
9833  */
9834  __Pyx_TraceLine(427,0,__PYX_ERR(2, 427, __pyx_L1_error))
9835  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
9836  __Pyx_GOTREF(__pyx_t_2);
9837  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
9838  __Pyx_GOTREF(__pyx_t_4);
9839  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9840  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9841 
9842  /* "View.MemoryView":426
9843  * if have_slices:
9844  * obj = self.is_slice(value)
9845  * if obj: # <<<<<<<<<<<<<<
9846  * self.setitem_slice_assignment(self[index], obj)
9847  * else:
9848  */
9849  goto __pyx_L5;
9850  }
9851 
9852  /* "View.MemoryView":429
9853  * self.setitem_slice_assignment(self[index], obj)
9854  * else:
9855  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
9856  * else:
9857  * self.setitem_indexed(index, value)
9858  */
9859  __Pyx_TraceLine(429,0,__PYX_ERR(2, 429, __pyx_L1_error))
9860  /*else*/ {
9861  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 429, __pyx_L1_error)
9862  __Pyx_GOTREF(__pyx_t_4);
9863  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 429, __pyx_L1_error)
9864  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
9865  __Pyx_GOTREF(__pyx_t_2);
9866  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9867  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9868  }
9869  __pyx_L5:;
9870 
9871  /* "View.MemoryView":424
9872  * have_slices, index = _unellipsify(index, self.view.ndim)
9873  *
9874  * if have_slices: # <<<<<<<<<<<<<<
9875  * obj = self.is_slice(value)
9876  * if obj:
9877  */
9878  goto __pyx_L4;
9879  }
9880 
9881  /* "View.MemoryView":431
9882  * self.setitem_slice_assign_scalar(self[index], value)
9883  * else:
9884  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
9885  *
9886  * cdef is_slice(self, obj):
9887  */
9888  __Pyx_TraceLine(431,0,__PYX_ERR(2, 431, __pyx_L1_error))
9889  /*else*/ {
9890  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 431, __pyx_L1_error)
9891  __Pyx_GOTREF(__pyx_t_2);
9892  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9893  }
9894  __pyx_L4:;
9895 
9896  /* "View.MemoryView":418
9897  * return self.convert_item_to_object(itemp)
9898  *
9899  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9900  * if self.view.readonly:
9901  * raise TypeError("Cannot assign to read-only memoryview")
9902  */
9903 
9904  /* function exit code */
9905  __pyx_r = 0;
9906  goto __pyx_L0;
9907  __pyx_L1_error:;
9908  __Pyx_XDECREF(__pyx_t_2);
9909  __Pyx_XDECREF(__pyx_t_3);
9910  __Pyx_XDECREF(__pyx_t_4);
9911  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9912  __pyx_r = -1;
9913  __pyx_L0:;
9914  __Pyx_XDECREF(__pyx_v_have_slices);
9915  __Pyx_XDECREF(__pyx_v_obj);
9916  __Pyx_XDECREF(__pyx_v_index);
9917  __Pyx_TraceReturn(Py_None, 0);
9918  __Pyx_RefNannyFinishContext();
9919  return __pyx_r;
9920 }
9921 
9922 /* "View.MemoryView":433
9923  * self.setitem_indexed(index, value)
9924  *
9925  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9926  * if not isinstance(obj, memoryview):
9927  * try:
9928  */
9929 
9930 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9931  PyObject *__pyx_r = NULL;
9932  __Pyx_TraceDeclarations
9933  __Pyx_RefNannyDeclarations
9934  int __pyx_t_1;
9935  int __pyx_t_2;
9936  PyObject *__pyx_t_3 = NULL;
9937  PyObject *__pyx_t_4 = NULL;
9938  PyObject *__pyx_t_5 = NULL;
9939  PyObject *__pyx_t_6 = NULL;
9940  PyObject *__pyx_t_7 = NULL;
9941  PyObject *__pyx_t_8 = NULL;
9942  int __pyx_t_9;
9943  int __pyx_lineno = 0;
9944  const char *__pyx_filename = NULL;
9945  int __pyx_clineno = 0;
9946  __Pyx_RefNannySetupContext("is_slice", 0);
9947  __Pyx_TraceCall("is_slice", __pyx_f[2], 433, 0, __PYX_ERR(2, 433, __pyx_L1_error));
9948  __Pyx_INCREF(__pyx_v_obj);
9949 
9950  /* "View.MemoryView":434
9951  *
9952  * cdef is_slice(self, obj):
9953  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9954  * try:
9955  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9956  */
9957  __Pyx_TraceLine(434,0,__PYX_ERR(2, 434, __pyx_L1_error))
9958  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9959  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9960  if (__pyx_t_2) {
9961 
9962  /* "View.MemoryView":435
9963  * cdef is_slice(self, obj):
9964  * if not isinstance(obj, memoryview):
9965  * try: # <<<<<<<<<<<<<<
9966  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9967  * self.dtype_is_object)
9968  */
9969  __Pyx_TraceLine(435,0,__PYX_ERR(2, 435, __pyx_L1_error))
9970  {
9971  __Pyx_PyThreadState_declare
9972  __Pyx_PyThreadState_assign
9973  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9974  __Pyx_XGOTREF(__pyx_t_3);
9975  __Pyx_XGOTREF(__pyx_t_4);
9976  __Pyx_XGOTREF(__pyx_t_5);
9977  /*try:*/ {
9978 
9979  /* "View.MemoryView":436
9980  * if not isinstance(obj, memoryview):
9981  * try:
9982  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9983  * self.dtype_is_object)
9984  * except TypeError:
9985  */
9986  __Pyx_TraceLine(436,0,__PYX_ERR(2, 436, __pyx_L4_error))
9987  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 436, __pyx_L4_error)
9988  __Pyx_GOTREF(__pyx_t_6);
9989 
9990  /* "View.MemoryView":437
9991  * try:
9992  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9993  * self.dtype_is_object) # <<<<<<<<<<<<<<
9994  * except TypeError:
9995  * return None
9996  */
9997  __Pyx_TraceLine(437,0,__PYX_ERR(2, 437, __pyx_L4_error))
9998  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 437, __pyx_L4_error)
9999  __Pyx_GOTREF(__pyx_t_7);
10000 
10001  /* "View.MemoryView":436
10002  * if not isinstance(obj, memoryview):
10003  * try:
10004  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10005  * self.dtype_is_object)
10006  * except TypeError:
10007  */
10008  __Pyx_TraceLine(436,0,__PYX_ERR(2, 436, __pyx_L4_error))
10009  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 436, __pyx_L4_error)
10010  __Pyx_GOTREF(__pyx_t_8);
10011  __Pyx_INCREF(__pyx_v_obj);
10012  __Pyx_GIVEREF(__pyx_v_obj);
10013  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10014  __Pyx_GIVEREF(__pyx_t_6);
10015  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10016  __Pyx_GIVEREF(__pyx_t_7);
10017  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10018  __pyx_t_6 = 0;
10019  __pyx_t_7 = 0;
10020  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 436, __pyx_L4_error)
10021  __Pyx_GOTREF(__pyx_t_7);
10022  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10023  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10024  __pyx_t_7 = 0;
10025 
10026  /* "View.MemoryView":435
10027  * cdef is_slice(self, obj):
10028  * if not isinstance(obj, memoryview):
10029  * try: # <<<<<<<<<<<<<<
10030  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10031  * self.dtype_is_object)
10032  */
10033  }
10034  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10035  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10036  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10037  goto __pyx_L9_try_end;
10038  __pyx_L4_error:;
10039  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10040  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10041  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10042 
10043  /* "View.MemoryView":438
10044  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10045  * self.dtype_is_object)
10046  * except TypeError: # <<<<<<<<<<<<<<
10047  * return None
10048  *
10049  */
10050  __Pyx_TraceLine(438,0,__PYX_ERR(2, 438, __pyx_L6_except_error))
10051  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10052  if (__pyx_t_9) {
10053  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10054  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 438, __pyx_L6_except_error)
10055  __Pyx_GOTREF(__pyx_t_7);
10056  __Pyx_GOTREF(__pyx_t_8);
10057  __Pyx_GOTREF(__pyx_t_6);
10058 
10059  /* "View.MemoryView":439
10060  * self.dtype_is_object)
10061  * except TypeError:
10062  * return None # <<<<<<<<<<<<<<
10063  *
10064  * return obj
10065  */
10066  __Pyx_TraceLine(439,0,__PYX_ERR(2, 439, __pyx_L6_except_error))
10067  __Pyx_XDECREF(__pyx_r);
10068  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10069  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10070  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10071  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10072  goto __pyx_L7_except_return;
10073  }
10074  goto __pyx_L6_except_error;
10075  __pyx_L6_except_error:;
10076 
10077  /* "View.MemoryView":435
10078  * cdef is_slice(self, obj):
10079  * if not isinstance(obj, memoryview):
10080  * try: # <<<<<<<<<<<<<<
10081  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10082  * self.dtype_is_object)
10083  */
10084  __Pyx_XGIVEREF(__pyx_t_3);
10085  __Pyx_XGIVEREF(__pyx_t_4);
10086  __Pyx_XGIVEREF(__pyx_t_5);
10087  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10088  goto __pyx_L1_error;
10089  __pyx_L7_except_return:;
10090  __Pyx_XGIVEREF(__pyx_t_3);
10091  __Pyx_XGIVEREF(__pyx_t_4);
10092  __Pyx_XGIVEREF(__pyx_t_5);
10093  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10094  goto __pyx_L0;
10095  __pyx_L9_try_end:;
10096  }
10097 
10098  /* "View.MemoryView":434
10099  *
10100  * cdef is_slice(self, obj):
10101  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10102  * try:
10103  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10104  */
10105  }
10106 
10107  /* "View.MemoryView":441
10108  * return None
10109  *
10110  * return obj # <<<<<<<<<<<<<<
10111  *
10112  * cdef setitem_slice_assignment(self, dst, src):
10113  */
10114  __Pyx_TraceLine(441,0,__PYX_ERR(2, 441, __pyx_L1_error))
10115  __Pyx_XDECREF(__pyx_r);
10116  __Pyx_INCREF(__pyx_v_obj);
10117  __pyx_r = __pyx_v_obj;
10118  goto __pyx_L0;
10119 
10120  /* "View.MemoryView":433
10121  * self.setitem_indexed(index, value)
10122  *
10123  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10124  * if not isinstance(obj, memoryview):
10125  * try:
10126  */
10127 
10128  /* function exit code */
10129  __pyx_L1_error:;
10130  __Pyx_XDECREF(__pyx_t_6);
10131  __Pyx_XDECREF(__pyx_t_7);
10132  __Pyx_XDECREF(__pyx_t_8);
10133  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10134  __pyx_r = 0;
10135  __pyx_L0:;
10136  __Pyx_XDECREF(__pyx_v_obj);
10137  __Pyx_XGIVEREF(__pyx_r);
10138  __Pyx_TraceReturn(__pyx_r, 0);
10139  __Pyx_RefNannyFinishContext();
10140  return __pyx_r;
10141 }
10142 
10143 /* "View.MemoryView":443
10144  * return obj
10145  *
10146  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10147  * cdef __Pyx_memviewslice dst_slice
10148  * cdef __Pyx_memviewslice src_slice
10149  */
10150 
10151 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10152  __Pyx_memviewslice __pyx_v_dst_slice;
10153  __Pyx_memviewslice __pyx_v_src_slice;
10154  PyObject *__pyx_r = NULL;
10155  __Pyx_TraceDeclarations
10156  __Pyx_RefNannyDeclarations
10157  __Pyx_memviewslice *__pyx_t_1;
10158  __Pyx_memviewslice *__pyx_t_2;
10159  PyObject *__pyx_t_3 = NULL;
10160  int __pyx_t_4;
10161  int __pyx_t_5;
10162  int __pyx_t_6;
10163  int __pyx_lineno = 0;
10164  const char *__pyx_filename = NULL;
10165  int __pyx_clineno = 0;
10166  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
10167  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[2], 443, 0, __PYX_ERR(2, 443, __pyx_L1_error));
10168 
10169  /* "View.MemoryView":447
10170  * cdef __Pyx_memviewslice src_slice
10171  *
10172  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10173  * get_slice_from_memview(dst, &dst_slice)[0],
10174  * src.ndim, dst.ndim, self.dtype_is_object)
10175  */
10176  __Pyx_TraceLine(447,0,__PYX_ERR(2, 447, __pyx_L1_error))
10177  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 447, __pyx_L1_error)
10178  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 447, __pyx_L1_error)
10179 
10180  /* "View.MemoryView":448
10181  *
10182  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10183  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
10184  * src.ndim, dst.ndim, self.dtype_is_object)
10185  *
10186  */
10187  __Pyx_TraceLine(448,0,__PYX_ERR(2, 448, __pyx_L1_error))
10188  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 448, __pyx_L1_error)
10189  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 448, __pyx_L1_error)
10190 
10191  /* "View.MemoryView":449
10192  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10193  * get_slice_from_memview(dst, &dst_slice)[0],
10194  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
10195  *
10196  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10197  */
10198  __Pyx_TraceLine(449,0,__PYX_ERR(2, 449, __pyx_L1_error))
10199  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error)
10200  __Pyx_GOTREF(__pyx_t_3);
10201  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error)
10202  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10203  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error)
10204  __Pyx_GOTREF(__pyx_t_3);
10205  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error)
10206  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10207 
10208  /* "View.MemoryView":447
10209  * cdef __Pyx_memviewslice src_slice
10210  *
10211  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10212  * get_slice_from_memview(dst, &dst_slice)[0],
10213  * src.ndim, dst.ndim, self.dtype_is_object)
10214  */
10215  __Pyx_TraceLine(447,0,__PYX_ERR(2, 447, __pyx_L1_error))
10216  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 447, __pyx_L1_error)
10217 
10218  /* "View.MemoryView":443
10219  * return obj
10220  *
10221  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10222  * cdef __Pyx_memviewslice dst_slice
10223  * cdef __Pyx_memviewslice src_slice
10224  */
10225 
10226  /* function exit code */
10227  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10228  goto __pyx_L0;
10229  __pyx_L1_error:;
10230  __Pyx_XDECREF(__pyx_t_3);
10231  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10232  __pyx_r = 0;
10233  __pyx_L0:;
10234  __Pyx_XGIVEREF(__pyx_r);
10235  __Pyx_TraceReturn(__pyx_r, 0);
10236  __Pyx_RefNannyFinishContext();
10237  return __pyx_r;
10238 }
10239 
10240 /* "View.MemoryView":451
10241  * src.ndim, dst.ndim, self.dtype_is_object)
10242  *
10243  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10244  * cdef int array[128]
10245  * cdef void *tmp = NULL
10246  */
10247 
10248 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10249  int __pyx_v_array[0x80];
10250  void *__pyx_v_tmp;
10251  void *__pyx_v_item;
10252  __Pyx_memviewslice *__pyx_v_dst_slice;
10253  __Pyx_memviewslice __pyx_v_tmp_slice;
10254  PyObject *__pyx_r = NULL;
10255  __Pyx_TraceDeclarations
10256  __Pyx_RefNannyDeclarations
10257  __Pyx_memviewslice *__pyx_t_1;
10258  int __pyx_t_2;
10259  PyObject *__pyx_t_3 = NULL;
10260  int __pyx_t_4;
10261  int __pyx_t_5;
10262  char const *__pyx_t_6;
10263  PyObject *__pyx_t_7 = NULL;
10264  PyObject *__pyx_t_8 = NULL;
10265  PyObject *__pyx_t_9 = NULL;
10266  PyObject *__pyx_t_10 = NULL;
10267  PyObject *__pyx_t_11 = NULL;
10268  PyObject *__pyx_t_12 = NULL;
10269  int __pyx_lineno = 0;
10270  const char *__pyx_filename = NULL;
10271  int __pyx_clineno = 0;
10272  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
10273  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[2], 451, 0, __PYX_ERR(2, 451, __pyx_L1_error));
10274 
10275  /* "View.MemoryView":453
10276  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10277  * cdef int array[128]
10278  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
10279  * cdef void *item
10280  *
10281  */
10282  __Pyx_TraceLine(453,0,__PYX_ERR(2, 453, __pyx_L1_error))
10283  __pyx_v_tmp = NULL;
10284 
10285  /* "View.MemoryView":458
10286  * cdef __Pyx_memviewslice *dst_slice
10287  * cdef __Pyx_memviewslice tmp_slice
10288  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
10289  *
10290  * if <size_t>self.view.itemsize > sizeof(array):
10291  */
10292  __Pyx_TraceLine(458,0,__PYX_ERR(2, 458, __pyx_L1_error))
10293  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 458, __pyx_L1_error)
10294  __pyx_v_dst_slice = __pyx_t_1;
10295 
10296  /* "View.MemoryView":460
10297  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10298  *
10299  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10300  * tmp = PyMem_Malloc(self.view.itemsize)
10301  * if tmp == NULL:
10302  */
10303  __Pyx_TraceLine(460,0,__PYX_ERR(2, 460, __pyx_L1_error))
10304  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
10305  if (__pyx_t_2) {
10306 
10307  /* "View.MemoryView":461
10308  *
10309  * if <size_t>self.view.itemsize > sizeof(array):
10310  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
10311  * if tmp == NULL:
10312  * raise MemoryError
10313  */
10314  __Pyx_TraceLine(461,0,__PYX_ERR(2, 461, __pyx_L1_error))
10315  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10316 
10317  /* "View.MemoryView":462
10318  * if <size_t>self.view.itemsize > sizeof(array):
10319  * tmp = PyMem_Malloc(self.view.itemsize)
10320  * if tmp == NULL: # <<<<<<<<<<<<<<
10321  * raise MemoryError
10322  * item = tmp
10323  */
10324  __Pyx_TraceLine(462,0,__PYX_ERR(2, 462, __pyx_L1_error))
10325  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
10326  if (unlikely(__pyx_t_2)) {
10327 
10328  /* "View.MemoryView":463
10329  * tmp = PyMem_Malloc(self.view.itemsize)
10330  * if tmp == NULL:
10331  * raise MemoryError # <<<<<<<<<<<<<<
10332  * item = tmp
10333  * else:
10334  */
10335  __Pyx_TraceLine(463,0,__PYX_ERR(2, 463, __pyx_L1_error))
10336  PyErr_NoMemory(); __PYX_ERR(2, 463, __pyx_L1_error)
10337 
10338  /* "View.MemoryView":462
10339  * if <size_t>self.view.itemsize > sizeof(array):
10340  * tmp = PyMem_Malloc(self.view.itemsize)
10341  * if tmp == NULL: # <<<<<<<<<<<<<<
10342  * raise MemoryError
10343  * item = tmp
10344  */
10345  }
10346 
10347  /* "View.MemoryView":464
10348  * if tmp == NULL:
10349  * raise MemoryError
10350  * item = tmp # <<<<<<<<<<<<<<
10351  * else:
10352  * item = <void *> array
10353  */
10354  __Pyx_TraceLine(464,0,__PYX_ERR(2, 464, __pyx_L1_error))
10355  __pyx_v_item = __pyx_v_tmp;
10356 
10357  /* "View.MemoryView":460
10358  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10359  *
10360  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10361  * tmp = PyMem_Malloc(self.view.itemsize)
10362  * if tmp == NULL:
10363  */
10364  goto __pyx_L3;
10365  }
10366 
10367  /* "View.MemoryView":466
10368  * item = tmp
10369  * else:
10370  * item = <void *> array # <<<<<<<<<<<<<<
10371  *
10372  * try:
10373  */
10374  __Pyx_TraceLine(466,0,__PYX_ERR(2, 466, __pyx_L1_error))
10375  /*else*/ {
10376  __pyx_v_item = ((void *)__pyx_v_array);
10377  }
10378  __pyx_L3:;
10379 
10380  /* "View.MemoryView":468
10381  * item = <void *> array
10382  *
10383  * try: # <<<<<<<<<<<<<<
10384  * if self.dtype_is_object:
10385  * (<PyObject **> item)[0] = <PyObject *> value
10386  */
10387  __Pyx_TraceLine(468,0,__PYX_ERR(2, 468, __pyx_L1_error))
10388  /*try:*/ {
10389 
10390  /* "View.MemoryView":469
10391  *
10392  * try:
10393  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10394  * (<PyObject **> item)[0] = <PyObject *> value
10395  * else:
10396  */
10397  __Pyx_TraceLine(469,0,__PYX_ERR(2, 469, __pyx_L6_error))
10398  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
10399  if (__pyx_t_2) {
10400 
10401  /* "View.MemoryView":470
10402  * try:
10403  * if self.dtype_is_object:
10404  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
10405  * else:
10406  * self.assign_item_from_object(<char *> item, value)
10407  */
10408  __Pyx_TraceLine(470,0,__PYX_ERR(2, 470, __pyx_L6_error))
10409  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10410 
10411  /* "View.MemoryView":469
10412  *
10413  * try:
10414  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10415  * (<PyObject **> item)[0] = <PyObject *> value
10416  * else:
10417  */
10418  goto __pyx_L8;
10419  }
10420 
10421  /* "View.MemoryView":472
10422  * (<PyObject **> item)[0] = <PyObject *> value
10423  * else:
10424  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
10425  *
10426  *
10427  */
10428  __Pyx_TraceLine(472,0,__PYX_ERR(2, 472, __pyx_L6_error))
10429  /*else*/ {
10430  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 472, __pyx_L6_error)
10431  __Pyx_GOTREF(__pyx_t_3);
10432  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10433  }
10434  __pyx_L8:;
10435 
10436  /* "View.MemoryView":476
10437  *
10438  *
10439  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10440  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10441  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10442  */
10443  __Pyx_TraceLine(476,0,__PYX_ERR(2, 476, __pyx_L6_error))
10444  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
10445  if (__pyx_t_2) {
10446 
10447  /* "View.MemoryView":477
10448  *
10449  * if self.view.suboffsets != NULL:
10450  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
10451  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10452  * item, self.dtype_is_object)
10453  */
10454  __Pyx_TraceLine(477,0,__PYX_ERR(2, 477, __pyx_L6_error))
10455  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 477, __pyx_L6_error)
10456  __Pyx_GOTREF(__pyx_t_3);
10457  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10458 
10459  /* "View.MemoryView":476
10460  *
10461  *
10462  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10463  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10464  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10465  */
10466  }
10467 
10468  /* "View.MemoryView":478
10469  * if self.view.suboffsets != NULL:
10470  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10471  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
10472  * item, self.dtype_is_object)
10473  * finally:
10474  */
10475  __Pyx_TraceLine(478,0,__PYX_ERR(2, 478, __pyx_L6_error))
10476  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10477  }
10478 
10479  /* "View.MemoryView":481
10480  * item, self.dtype_is_object)
10481  * finally:
10482  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
10483  *
10484  * cdef setitem_indexed(self, index, value):
10485  */
10486  __Pyx_TraceLine(481,0,__PYX_ERR(2, 481, __pyx_L6_error))
10487  /*finally:*/ {
10488  /*normal exit:*/{
10489  PyMem_Free(__pyx_v_tmp);
10490  goto __pyx_L7;
10491  }
10492  __pyx_L6_error:;
10493  /*exception exit:*/{
10494  __Pyx_PyThreadState_declare
10495  __Pyx_PyThreadState_assign
10496  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10497  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10498  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10499  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10500  __Pyx_XGOTREF(__pyx_t_7);
10501  __Pyx_XGOTREF(__pyx_t_8);
10502  __Pyx_XGOTREF(__pyx_t_9);
10503  __Pyx_XGOTREF(__pyx_t_10);
10504  __Pyx_XGOTREF(__pyx_t_11);
10505  __Pyx_XGOTREF(__pyx_t_12);
10506  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10507  {
10508  PyMem_Free(__pyx_v_tmp);
10509  }
10510  if (PY_MAJOR_VERSION >= 3) {
10511  __Pyx_XGIVEREF(__pyx_t_10);
10512  __Pyx_XGIVEREF(__pyx_t_11);
10513  __Pyx_XGIVEREF(__pyx_t_12);
10514  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10515  }
10516  __Pyx_XGIVEREF(__pyx_t_7);
10517  __Pyx_XGIVEREF(__pyx_t_8);
10518  __Pyx_XGIVEREF(__pyx_t_9);
10519  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10520  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10521  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10522  goto __pyx_L1_error;
10523  }
10524  __pyx_L7:;
10525  }
10526 
10527  /* "View.MemoryView":451
10528  * src.ndim, dst.ndim, self.dtype_is_object)
10529  *
10530  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10531  * cdef int array[128]
10532  * cdef void *tmp = NULL
10533  */
10534 
10535  /* function exit code */
10536  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10537  goto __pyx_L0;
10538  __pyx_L1_error:;
10539  __Pyx_XDECREF(__pyx_t_3);
10540  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10541  __pyx_r = 0;
10542  __pyx_L0:;
10543  __Pyx_XGIVEREF(__pyx_r);
10544  __Pyx_TraceReturn(__pyx_r, 0);
10545  __Pyx_RefNannyFinishContext();
10546  return __pyx_r;
10547 }
10548 
10549 /* "View.MemoryView":483
10550  * PyMem_Free(tmp)
10551  *
10552  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10553  * cdef char *itemp = self.get_item_pointer(index)
10554  * self.assign_item_from_object(itemp, value)
10555  */
10556 
10557 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10558  char *__pyx_v_itemp;
10559  PyObject *__pyx_r = NULL;
10560  __Pyx_TraceDeclarations
10561  __Pyx_RefNannyDeclarations
10562  char *__pyx_t_1;
10563  PyObject *__pyx_t_2 = NULL;
10564  int __pyx_lineno = 0;
10565  const char *__pyx_filename = NULL;
10566  int __pyx_clineno = 0;
10567  __Pyx_RefNannySetupContext("setitem_indexed", 0);
10568  __Pyx_TraceCall("setitem_indexed", __pyx_f[2], 483, 0, __PYX_ERR(2, 483, __pyx_L1_error));
10569 
10570  /* "View.MemoryView":484
10571  *
10572  * cdef setitem_indexed(self, index, value):
10573  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
10574  * self.assign_item_from_object(itemp, value)
10575  *
10576  */
10577  __Pyx_TraceLine(484,0,__PYX_ERR(2, 484, __pyx_L1_error))
10578  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 484, __pyx_L1_error)
10579  __pyx_v_itemp = __pyx_t_1;
10580 
10581  /* "View.MemoryView":485
10582  * cdef setitem_indexed(self, index, value):
10583  * cdef char *itemp = self.get_item_pointer(index)
10584  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
10585  *
10586  * cdef convert_item_to_object(self, char *itemp):
10587  */
10588  __Pyx_TraceLine(485,0,__PYX_ERR(2, 485, __pyx_L1_error))
10589  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error)
10590  __Pyx_GOTREF(__pyx_t_2);
10591  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10592 
10593  /* "View.MemoryView":483
10594  * PyMem_Free(tmp)
10595  *
10596  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10597  * cdef char *itemp = self.get_item_pointer(index)
10598  * self.assign_item_from_object(itemp, value)
10599  */
10600 
10601  /* function exit code */
10602  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10603  goto __pyx_L0;
10604  __pyx_L1_error:;
10605  __Pyx_XDECREF(__pyx_t_2);
10606  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10607  __pyx_r = 0;
10608  __pyx_L0:;
10609  __Pyx_XGIVEREF(__pyx_r);
10610  __Pyx_TraceReturn(__pyx_r, 0);
10611  __Pyx_RefNannyFinishContext();
10612  return __pyx_r;
10613 }
10614 
10615 /* "View.MemoryView":487
10616  * self.assign_item_from_object(itemp, value)
10617  *
10618  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10619  * """Only used if instantiated manually by the user, or if Cython doesn't
10620  * know how to convert the type"""
10621  */
10622 
10623 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
10624  PyObject *__pyx_v_struct = NULL;
10625  PyObject *__pyx_v_bytesitem = 0;
10626  PyObject *__pyx_v_result = NULL;
10627  PyObject *__pyx_r = NULL;
10628  __Pyx_TraceDeclarations
10629  __Pyx_RefNannyDeclarations
10630  PyObject *__pyx_t_1 = NULL;
10631  PyObject *__pyx_t_2 = NULL;
10632  PyObject *__pyx_t_3 = NULL;
10633  PyObject *__pyx_t_4 = NULL;
10634  PyObject *__pyx_t_5 = NULL;
10635  PyObject *__pyx_t_6 = NULL;
10636  PyObject *__pyx_t_7 = NULL;
10637  int __pyx_t_8;
10638  PyObject *__pyx_t_9 = NULL;
10639  size_t __pyx_t_10;
10640  int __pyx_t_11;
10641  int __pyx_lineno = 0;
10642  const char *__pyx_filename = NULL;
10643  int __pyx_clineno = 0;
10644  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
10645  __Pyx_TraceCall("convert_item_to_object", __pyx_f[2], 487, 0, __PYX_ERR(2, 487, __pyx_L1_error));
10646 
10647  /* "View.MemoryView":490
10648  * """Only used if instantiated manually by the user, or if Cython doesn't
10649  * know how to convert the type"""
10650  * import struct # <<<<<<<<<<<<<<
10651  * cdef bytes bytesitem
10652  *
10653  */
10654  __Pyx_TraceLine(490,0,__PYX_ERR(2, 490, __pyx_L1_error))
10655  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 490, __pyx_L1_error)
10656  __Pyx_GOTREF(__pyx_t_1);
10657  __pyx_v_struct = __pyx_t_1;
10658  __pyx_t_1 = 0;
10659 
10660  /* "View.MemoryView":493
10661  * cdef bytes bytesitem
10662  *
10663  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10664  * try:
10665  * result = struct.unpack(self.view.format, bytesitem)
10666  */
10667  __Pyx_TraceLine(493,0,__PYX_ERR(2, 493, __pyx_L1_error))
10668  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
10669  __Pyx_GOTREF(__pyx_t_1);
10670  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10671  __pyx_t_1 = 0;
10672 
10673  /* "View.MemoryView":494
10674  *
10675  * bytesitem = itemp[:self.view.itemsize]
10676  * try: # <<<<<<<<<<<<<<
10677  * result = struct.unpack(self.view.format, bytesitem)
10678  * except struct.error:
10679  */
10680  __Pyx_TraceLine(494,0,__PYX_ERR(2, 494, __pyx_L1_error))
10681  {
10682  __Pyx_PyThreadState_declare
10683  __Pyx_PyThreadState_assign
10684  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10685  __Pyx_XGOTREF(__pyx_t_2);
10686  __Pyx_XGOTREF(__pyx_t_3);
10687  __Pyx_XGOTREF(__pyx_t_4);
10688  /*try:*/ {
10689 
10690  /* "View.MemoryView":495
10691  * bytesitem = itemp[:self.view.itemsize]
10692  * try:
10693  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10694  * except struct.error:
10695  * raise ValueError("Unable to convert item to object")
10696  */
10697  __Pyx_TraceLine(495,0,__PYX_ERR(2, 495, __pyx_L3_error))
10698  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 495, __pyx_L3_error)
10699  __Pyx_GOTREF(__pyx_t_5);
10700  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L3_error)
10701  __Pyx_GOTREF(__pyx_t_6);
10702  __pyx_t_7 = NULL;
10703  __pyx_t_8 = 0;
10704  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10705  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10706  if (likely(__pyx_t_7)) {
10707  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10708  __Pyx_INCREF(__pyx_t_7);
10709  __Pyx_INCREF(function);
10710  __Pyx_DECREF_SET(__pyx_t_5, function);
10711  __pyx_t_8 = 1;
10712  }
10713  }
10714  #if CYTHON_FAST_PYCALL
10715  if (PyFunction_Check(__pyx_t_5)) {
10716  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10717  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
10718  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10719  __Pyx_GOTREF(__pyx_t_1);
10720  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10721  } else
10722  #endif
10723  #if CYTHON_FAST_PYCCALL
10724  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10725  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10726  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
10727  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10728  __Pyx_GOTREF(__pyx_t_1);
10729  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10730  } else
10731  #endif
10732  {
10733  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 495, __pyx_L3_error)
10734  __Pyx_GOTREF(__pyx_t_9);
10735  if (__pyx_t_7) {
10736  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10737  }
10738  __Pyx_GIVEREF(__pyx_t_6);
10739  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
10740  __Pyx_INCREF(__pyx_v_bytesitem);
10741  __Pyx_GIVEREF(__pyx_v_bytesitem);
10742  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
10743  __pyx_t_6 = 0;
10744  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
10745  __Pyx_GOTREF(__pyx_t_1);
10746  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10747  }
10748  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10749  __pyx_v_result = __pyx_t_1;
10750  __pyx_t_1 = 0;
10751 
10752  /* "View.MemoryView":494
10753  *
10754  * bytesitem = itemp[:self.view.itemsize]
10755  * try: # <<<<<<<<<<<<<<
10756  * result = struct.unpack(self.view.format, bytesitem)
10757  * except struct.error:
10758  */
10759  }
10760 
10761  /* "View.MemoryView":499
10762  * raise ValueError("Unable to convert item to object")
10763  * else:
10764  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10765  * return result[0]
10766  * return result
10767  */
10768  __Pyx_TraceLine(499,0,__PYX_ERR(2, 499, __pyx_L5_except_error))
10769  /*else:*/ {
10770  __pyx_t_10 = strlen(__pyx_v_self->view.format);
10771  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
10772  if (__pyx_t_11) {
10773 
10774  /* "View.MemoryView":500
10775  * else:
10776  * if len(self.view.format) == 1:
10777  * return result[0] # <<<<<<<<<<<<<<
10778  * return result
10779  *
10780  */
10781  __Pyx_TraceLine(500,0,__PYX_ERR(2, 500, __pyx_L5_except_error))
10782  __Pyx_XDECREF(__pyx_r);
10783  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L5_except_error)
10784  __Pyx_GOTREF(__pyx_t_1);
10785  __pyx_r = __pyx_t_1;
10786  __pyx_t_1 = 0;
10787  goto __pyx_L6_except_return;
10788 
10789  /* "View.MemoryView":499
10790  * raise ValueError("Unable to convert item to object")
10791  * else:
10792  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10793  * return result[0]
10794  * return result
10795  */
10796  }
10797 
10798  /* "View.MemoryView":501
10799  * if len(self.view.format) == 1:
10800  * return result[0]
10801  * return result # <<<<<<<<<<<<<<
10802  *
10803  * cdef assign_item_from_object(self, char *itemp, object value):
10804  */
10805  __Pyx_TraceLine(501,0,__PYX_ERR(2, 501, __pyx_L5_except_error))
10806  __Pyx_XDECREF(__pyx_r);
10807  __Pyx_INCREF(__pyx_v_result);
10808  __pyx_r = __pyx_v_result;
10809  goto __pyx_L6_except_return;
10810  }
10811  __pyx_L3_error:;
10812  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10813  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10814  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10815  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10816  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10817 
10818  /* "View.MemoryView":496
10819  * try:
10820  * result = struct.unpack(self.view.format, bytesitem)
10821  * except struct.error: # <<<<<<<<<<<<<<
10822  * raise ValueError("Unable to convert item to object")
10823  * else:
10824  */
10825  __Pyx_TraceLine(496,0,__PYX_ERR(2, 496, __pyx_L5_except_error))
10826  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
10827  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 496, __pyx_L5_except_error)
10828  __Pyx_GOTREF(__pyx_t_6);
10829  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
10830  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10831  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
10832  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
10833  if (__pyx_t_8) {
10834  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10835  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 496, __pyx_L5_except_error)
10836  __Pyx_GOTREF(__pyx_t_9);
10837  __Pyx_GOTREF(__pyx_t_5);
10838  __Pyx_GOTREF(__pyx_t_1);
10839 
10840  /* "View.MemoryView":497
10841  * result = struct.unpack(self.view.format, bytesitem)
10842  * except struct.error:
10843  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
10844  * else:
10845  * if len(self.view.format) == 1:
10846  */
10847  __Pyx_TraceLine(497,0,__PYX_ERR(2, 497, __pyx_L5_except_error))
10848  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 497, __pyx_L5_except_error)
10849  __Pyx_GOTREF(__pyx_t_6);
10850  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10851  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10852  __PYX_ERR(2, 497, __pyx_L5_except_error)
10853  }
10854  goto __pyx_L5_except_error;
10855  __pyx_L5_except_error:;
10856 
10857  /* "View.MemoryView":494
10858  *
10859  * bytesitem = itemp[:self.view.itemsize]
10860  * try: # <<<<<<<<<<<<<<
10861  * result = struct.unpack(self.view.format, bytesitem)
10862  * except struct.error:
10863  */
10864  __Pyx_XGIVEREF(__pyx_t_2);
10865  __Pyx_XGIVEREF(__pyx_t_3);
10866  __Pyx_XGIVEREF(__pyx_t_4);
10867  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10868  goto __pyx_L1_error;
10869  __pyx_L6_except_return:;
10870  __Pyx_XGIVEREF(__pyx_t_2);
10871  __Pyx_XGIVEREF(__pyx_t_3);
10872  __Pyx_XGIVEREF(__pyx_t_4);
10873  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10874  goto __pyx_L0;
10875  }
10876 
10877  /* "View.MemoryView":487
10878  * self.assign_item_from_object(itemp, value)
10879  *
10880  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10881  * """Only used if instantiated manually by the user, or if Cython doesn't
10882  * know how to convert the type"""
10883  */
10884 
10885  /* function exit code */
10886  __pyx_L1_error:;
10887  __Pyx_XDECREF(__pyx_t_1);
10888  __Pyx_XDECREF(__pyx_t_5);
10889  __Pyx_XDECREF(__pyx_t_6);
10890  __Pyx_XDECREF(__pyx_t_7);
10891  __Pyx_XDECREF(__pyx_t_9);
10892  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10893  __pyx_r = 0;
10894  __pyx_L0:;
10895  __Pyx_XDECREF(__pyx_v_struct);
10896  __Pyx_XDECREF(__pyx_v_bytesitem);
10897  __Pyx_XDECREF(__pyx_v_result);
10898  __Pyx_XGIVEREF(__pyx_r);
10899  __Pyx_TraceReturn(__pyx_r, 0);
10900  __Pyx_RefNannyFinishContext();
10901  return __pyx_r;
10902 }
10903 
10904 /* "View.MemoryView":503
10905  * return result
10906  *
10907  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10908  * """Only used if instantiated manually by the user, or if Cython doesn't
10909  * know how to convert the type"""
10910  */
10911 
10912 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10913  PyObject *__pyx_v_struct = NULL;
10914  char __pyx_v_c;
10915  PyObject *__pyx_v_bytesvalue = 0;
10916  Py_ssize_t __pyx_v_i;
10917  PyObject *__pyx_r = NULL;
10918  __Pyx_TraceDeclarations
10919  __Pyx_RefNannyDeclarations
10920  PyObject *__pyx_t_1 = NULL;
10921  int __pyx_t_2;
10922  int __pyx_t_3;
10923  PyObject *__pyx_t_4 = NULL;
10924  PyObject *__pyx_t_5 = NULL;
10925  PyObject *__pyx_t_6 = NULL;
10926  int __pyx_t_7;
10927  PyObject *__pyx_t_8 = NULL;
10928  Py_ssize_t __pyx_t_9;
10929  PyObject *__pyx_t_10 = NULL;
10930  char *__pyx_t_11;
10931  char *__pyx_t_12;
10932  char *__pyx_t_13;
10933  char *__pyx_t_14;
10934  int __pyx_lineno = 0;
10935  const char *__pyx_filename = NULL;
10936  int __pyx_clineno = 0;
10937  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
10938  __Pyx_TraceCall("assign_item_from_object", __pyx_f[2], 503, 0, __PYX_ERR(2, 503, __pyx_L1_error));
10939 
10940  /* "View.MemoryView":506
10941  * """Only used if instantiated manually by the user, or if Cython doesn't
10942  * know how to convert the type"""
10943  * import struct # <<<<<<<<<<<<<<
10944  * cdef char c
10945  * cdef bytes bytesvalue
10946  */
10947  __Pyx_TraceLine(506,0,__PYX_ERR(2, 506, __pyx_L1_error))
10948  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error)
10949  __Pyx_GOTREF(__pyx_t_1);
10950  __pyx_v_struct = __pyx_t_1;
10951  __pyx_t_1 = 0;
10952 
10953  /* "View.MemoryView":511
10954  * cdef Py_ssize_t i
10955  *
10956  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10957  * bytesvalue = struct.pack(self.view.format, *value)
10958  * else:
10959  */
10960  __Pyx_TraceLine(511,0,__PYX_ERR(2, 511, __pyx_L1_error))
10961  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10962  __pyx_t_3 = (__pyx_t_2 != 0);
10963  if (__pyx_t_3) {
10964 
10965  /* "View.MemoryView":512
10966  *
10967  * if isinstance(value, tuple):
10968  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
10969  * else:
10970  * bytesvalue = struct.pack(self.view.format, value)
10971  */
10972  __Pyx_TraceLine(512,0,__PYX_ERR(2, 512, __pyx_L1_error))
10973  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
10974  __Pyx_GOTREF(__pyx_t_1);
10975  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10976  __Pyx_GOTREF(__pyx_t_4);
10977  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 512, __pyx_L1_error)
10978  __Pyx_GOTREF(__pyx_t_5);
10979  __Pyx_GIVEREF(__pyx_t_4);
10980  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10981  __pyx_t_4 = 0;
10982  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10983  __Pyx_GOTREF(__pyx_t_4);
10984  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
10985  __Pyx_GOTREF(__pyx_t_6);
10986  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10987  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10988  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10989  __Pyx_GOTREF(__pyx_t_4);
10990  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10991  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10992  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
10993  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10994  __pyx_t_4 = 0;
10995 
10996  /* "View.MemoryView":511
10997  * cdef Py_ssize_t i
10998  *
10999  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11000  * bytesvalue = struct.pack(self.view.format, *value)
11001  * else:
11002  */
11003  goto __pyx_L3;
11004  }
11005 
11006  /* "View.MemoryView":514
11007  * bytesvalue = struct.pack(self.view.format, *value)
11008  * else:
11009  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
11010  *
11011  * for i, c in enumerate(bytesvalue):
11012  */
11013  __Pyx_TraceLine(514,0,__PYX_ERR(2, 514, __pyx_L1_error))
11014  /*else*/ {
11015  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 514, __pyx_L1_error)
11016  __Pyx_GOTREF(__pyx_t_6);
11017  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error)
11018  __Pyx_GOTREF(__pyx_t_1);
11019  __pyx_t_5 = NULL;
11020  __pyx_t_7 = 0;
11021  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11022  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11023  if (likely(__pyx_t_5)) {
11024  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
11025  __Pyx_INCREF(__pyx_t_5);
11026  __Pyx_INCREF(function);
11027  __Pyx_DECREF_SET(__pyx_t_6, function);
11028  __pyx_t_7 = 1;
11029  }
11030  }
11031  #if CYTHON_FAST_PYCALL
11032  if (PyFunction_Check(__pyx_t_6)) {
11033  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11034  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
11035  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11036  __Pyx_GOTREF(__pyx_t_4);
11037  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11038  } else
11039  #endif
11040  #if CYTHON_FAST_PYCCALL
11041  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11042  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11043  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
11044  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11045  __Pyx_GOTREF(__pyx_t_4);
11046  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11047  } else
11048  #endif
11049  {
11050  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error)
11051  __Pyx_GOTREF(__pyx_t_8);
11052  if (__pyx_t_5) {
11053  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11054  }
11055  __Pyx_GIVEREF(__pyx_t_1);
11056  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11057  __Pyx_INCREF(__pyx_v_value);
11058  __Pyx_GIVEREF(__pyx_v_value);
11059  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11060  __pyx_t_1 = 0;
11061  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
11062  __Pyx_GOTREF(__pyx_t_4);
11063  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11064  }
11065  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11066  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 514, __pyx_L1_error)
11067  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11068  __pyx_t_4 = 0;
11069  }
11070  __pyx_L3:;
11071 
11072  /* "View.MemoryView":516
11073  * bytesvalue = struct.pack(self.view.format, value)
11074  *
11075  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11076  * itemp[i] = c
11077  *
11078  */
11079  __Pyx_TraceLine(516,0,__PYX_ERR(2, 516, __pyx_L1_error))
11080  __pyx_t_9 = 0;
11081  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11082  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
11083  __PYX_ERR(2, 516, __pyx_L1_error)
11084  }
11085  __Pyx_INCREF(__pyx_v_bytesvalue);
11086  __pyx_t_10 = __pyx_v_bytesvalue;
11087  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11088  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11089  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11090  __pyx_t_11 = __pyx_t_14;
11091  __pyx_v_c = (__pyx_t_11[0]);
11092 
11093  /* "View.MemoryView":517
11094  *
11095  * for i, c in enumerate(bytesvalue):
11096  * itemp[i] = c # <<<<<<<<<<<<<<
11097  *
11098  * @cname('getbuffer')
11099  */
11100  __Pyx_TraceLine(517,0,__PYX_ERR(2, 517, __pyx_L1_error))
11101  __pyx_v_i = __pyx_t_9;
11102 
11103  /* "View.MemoryView":516
11104  * bytesvalue = struct.pack(self.view.format, value)
11105  *
11106  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11107  * itemp[i] = c
11108  *
11109  */
11110  __Pyx_TraceLine(516,0,__PYX_ERR(2, 516, __pyx_L1_error))
11111  __pyx_t_9 = (__pyx_t_9 + 1);
11112 
11113  /* "View.MemoryView":517
11114  *
11115  * for i, c in enumerate(bytesvalue):
11116  * itemp[i] = c # <<<<<<<<<<<<<<
11117  *
11118  * @cname('getbuffer')
11119  */
11120  __Pyx_TraceLine(517,0,__PYX_ERR(2, 517, __pyx_L1_error))
11121  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11122  }
11123  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11124 
11125  /* "View.MemoryView":503
11126  * return result
11127  *
11128  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11129  * """Only used if instantiated manually by the user, or if Cython doesn't
11130  * know how to convert the type"""
11131  */
11132 
11133  /* function exit code */
11134  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11135  goto __pyx_L0;
11136  __pyx_L1_error:;
11137  __Pyx_XDECREF(__pyx_t_1);
11138  __Pyx_XDECREF(__pyx_t_4);
11139  __Pyx_XDECREF(__pyx_t_5);
11140  __Pyx_XDECREF(__pyx_t_6);
11141  __Pyx_XDECREF(__pyx_t_8);
11142  __Pyx_XDECREF(__pyx_t_10);
11143  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11144  __pyx_r = 0;
11145  __pyx_L0:;
11146  __Pyx_XDECREF(__pyx_v_struct);
11147  __Pyx_XDECREF(__pyx_v_bytesvalue);
11148  __Pyx_XGIVEREF(__pyx_r);
11149  __Pyx_TraceReturn(__pyx_r, 0);
11150  __Pyx_RefNannyFinishContext();
11151  return __pyx_r;
11152 }
11153 
11154 /* "View.MemoryView":520
11155  *
11156  * @cname('getbuffer')
11157  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11158  * if flags & PyBUF_WRITABLE and self.view.readonly:
11159  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11160  */
11161 
11162 /* Python wrapper */
11163 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
11164 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11165  int __pyx_r;
11166  __Pyx_RefNannyDeclarations
11167  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
11168  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
11169 
11170  /* function exit code */
11171  __Pyx_RefNannyFinishContext();
11172  return __pyx_r;
11173 }
11174 
11175 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11176  int __pyx_r;
11177  __Pyx_TraceDeclarations
11178  __Pyx_RefNannyDeclarations
11179  int __pyx_t_1;
11180  int __pyx_t_2;
11181  PyObject *__pyx_t_3 = NULL;
11182  Py_ssize_t *__pyx_t_4;
11183  char *__pyx_t_5;
11184  void *__pyx_t_6;
11185  int __pyx_t_7;
11186  Py_ssize_t __pyx_t_8;
11187  int __pyx_lineno = 0;
11188  const char *__pyx_filename = NULL;
11189  int __pyx_clineno = 0;
11190  if (__pyx_v_info == NULL) {
11191  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
11192  return -1;
11193  }
11194  __Pyx_RefNannySetupContext("__getbuffer__", 0);
11195  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11196  __Pyx_GIVEREF(__pyx_v_info->obj);
11197  __Pyx_TraceCall("__getbuffer__", __pyx_f[2], 520, 0, __PYX_ERR(2, 520, __pyx_L1_error));
11198 
11199  /* "View.MemoryView":521
11200  * @cname('getbuffer')
11201  * def __getbuffer__(self, Py_buffer *info, int flags):
11202  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11203  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11204  *
11205  */
11206  __Pyx_TraceLine(521,0,__PYX_ERR(2, 521, __pyx_L1_error))
11207  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11208  if (__pyx_t_2) {
11209  } else {
11210  __pyx_t_1 = __pyx_t_2;
11211  goto __pyx_L4_bool_binop_done;
11212  }
11213  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11214  __pyx_t_1 = __pyx_t_2;
11215  __pyx_L4_bool_binop_done:;
11216  if (unlikely(__pyx_t_1)) {
11217 
11218  /* "View.MemoryView":522
11219  * def __getbuffer__(self, Py_buffer *info, int flags):
11220  * if flags & PyBUF_WRITABLE and self.view.readonly:
11221  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
11222  *
11223  * if flags & PyBUF_ND:
11224  */
11225  __Pyx_TraceLine(522,0,__PYX_ERR(2, 522, __pyx_L1_error))
11226  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 522, __pyx_L1_error)
11227  __Pyx_GOTREF(__pyx_t_3);
11228  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11229  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11230  __PYX_ERR(2, 522, __pyx_L1_error)
11231 
11232  /* "View.MemoryView":521
11233  * @cname('getbuffer')
11234  * def __getbuffer__(self, Py_buffer *info, int flags):
11235  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11236  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11237  *
11238  */
11239  }
11240 
11241  /* "View.MemoryView":524
11242  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11243  *
11244  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11245  * info.shape = self.view.shape
11246  * else:
11247  */
11248  __Pyx_TraceLine(524,0,__PYX_ERR(2, 524, __pyx_L1_error))
11249  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11250  if (__pyx_t_1) {
11251 
11252  /* "View.MemoryView":525
11253  *
11254  * if flags & PyBUF_ND:
11255  * info.shape = self.view.shape # <<<<<<<<<<<<<<
11256  * else:
11257  * info.shape = NULL
11258  */
11259  __Pyx_TraceLine(525,0,__PYX_ERR(2, 525, __pyx_L1_error))
11260  __pyx_t_4 = __pyx_v_self->view.shape;
11261  __pyx_v_info->shape = __pyx_t_4;
11262 
11263  /* "View.MemoryView":524
11264  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11265  *
11266  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11267  * info.shape = self.view.shape
11268  * else:
11269  */
11270  goto __pyx_L6;
11271  }
11272 
11273  /* "View.MemoryView":527
11274  * info.shape = self.view.shape
11275  * else:
11276  * info.shape = NULL # <<<<<<<<<<<<<<
11277  *
11278  * if flags & PyBUF_STRIDES:
11279  */
11280  __Pyx_TraceLine(527,0,__PYX_ERR(2, 527, __pyx_L1_error))
11281  /*else*/ {
11282  __pyx_v_info->shape = NULL;
11283  }
11284  __pyx_L6:;
11285 
11286  /* "View.MemoryView":529
11287  * info.shape = NULL
11288  *
11289  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11290  * info.strides = self.view.strides
11291  * else:
11292  */
11293  __Pyx_TraceLine(529,0,__PYX_ERR(2, 529, __pyx_L1_error))
11294  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11295  if (__pyx_t_1) {
11296 
11297  /* "View.MemoryView":530
11298  *
11299  * if flags & PyBUF_STRIDES:
11300  * info.strides = self.view.strides # <<<<<<<<<<<<<<
11301  * else:
11302  * info.strides = NULL
11303  */
11304  __Pyx_TraceLine(530,0,__PYX_ERR(2, 530, __pyx_L1_error))
11305  __pyx_t_4 = __pyx_v_self->view.strides;
11306  __pyx_v_info->strides = __pyx_t_4;
11307 
11308  /* "View.MemoryView":529
11309  * info.shape = NULL
11310  *
11311  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11312  * info.strides = self.view.strides
11313  * else:
11314  */
11315  goto __pyx_L7;
11316  }
11317 
11318  /* "View.MemoryView":532
11319  * info.strides = self.view.strides
11320  * else:
11321  * info.strides = NULL # <<<<<<<<<<<<<<
11322  *
11323  * if flags & PyBUF_INDIRECT:
11324  */
11325  __Pyx_TraceLine(532,0,__PYX_ERR(2, 532, __pyx_L1_error))
11326  /*else*/ {
11327  __pyx_v_info->strides = NULL;
11328  }
11329  __pyx_L7:;
11330 
11331  /* "View.MemoryView":534
11332  * info.strides = NULL
11333  *
11334  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11335  * info.suboffsets = self.view.suboffsets
11336  * else:
11337  */
11338  __Pyx_TraceLine(534,0,__PYX_ERR(2, 534, __pyx_L1_error))
11339  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11340  if (__pyx_t_1) {
11341 
11342  /* "View.MemoryView":535
11343  *
11344  * if flags & PyBUF_INDIRECT:
11345  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
11346  * else:
11347  * info.suboffsets = NULL
11348  */
11349  __Pyx_TraceLine(535,0,__PYX_ERR(2, 535, __pyx_L1_error))
11350  __pyx_t_4 = __pyx_v_self->view.suboffsets;
11351  __pyx_v_info->suboffsets = __pyx_t_4;
11352 
11353  /* "View.MemoryView":534
11354  * info.strides = NULL
11355  *
11356  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11357  * info.suboffsets = self.view.suboffsets
11358  * else:
11359  */
11360  goto __pyx_L8;
11361  }
11362 
11363  /* "View.MemoryView":537
11364  * info.suboffsets = self.view.suboffsets
11365  * else:
11366  * info.suboffsets = NULL # <<<<<<<<<<<<<<
11367  *
11368  * if flags & PyBUF_FORMAT:
11369  */
11370  __Pyx_TraceLine(537,0,__PYX_ERR(2, 537, __pyx_L1_error))
11371  /*else*/ {
11372  __pyx_v_info->suboffsets = NULL;
11373  }
11374  __pyx_L8:;
11375 
11376  /* "View.MemoryView":539
11377  * info.suboffsets = NULL
11378  *
11379  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11380  * info.format = self.view.format
11381  * else:
11382  */
11383  __Pyx_TraceLine(539,0,__PYX_ERR(2, 539, __pyx_L1_error))
11384  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11385  if (__pyx_t_1) {
11386 
11387  /* "View.MemoryView":540
11388  *
11389  * if flags & PyBUF_FORMAT:
11390  * info.format = self.view.format # <<<<<<<<<<<<<<
11391  * else:
11392  * info.format = NULL
11393  */
11394  __Pyx_TraceLine(540,0,__PYX_ERR(2, 540, __pyx_L1_error))
11395  __pyx_t_5 = __pyx_v_self->view.format;
11396  __pyx_v_info->format = __pyx_t_5;
11397 
11398  /* "View.MemoryView":539
11399  * info.suboffsets = NULL
11400  *
11401  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11402  * info.format = self.view.format
11403  * else:
11404  */
11405  goto __pyx_L9;
11406  }
11407 
11408  /* "View.MemoryView":542
11409  * info.format = self.view.format
11410  * else:
11411  * info.format = NULL # <<<<<<<<<<<<<<
11412  *
11413  * info.buf = self.view.buf
11414  */
11415  __Pyx_TraceLine(542,0,__PYX_ERR(2, 542, __pyx_L1_error))
11416  /*else*/ {
11417  __pyx_v_info->format = NULL;
11418  }
11419  __pyx_L9:;
11420 
11421  /* "View.MemoryView":544
11422  * info.format = NULL
11423  *
11424  * info.buf = self.view.buf # <<<<<<<<<<<<<<
11425  * info.ndim = self.view.ndim
11426  * info.itemsize = self.view.itemsize
11427  */
11428  __Pyx_TraceLine(544,0,__PYX_ERR(2, 544, __pyx_L1_error))
11429  __pyx_t_6 = __pyx_v_self->view.buf;
11430  __pyx_v_info->buf = __pyx_t_6;
11431 
11432  /* "View.MemoryView":545
11433  *
11434  * info.buf = self.view.buf
11435  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
11436  * info.itemsize = self.view.itemsize
11437  * info.len = self.view.len
11438  */
11439  __Pyx_TraceLine(545,0,__PYX_ERR(2, 545, __pyx_L1_error))
11440  __pyx_t_7 = __pyx_v_self->view.ndim;
11441  __pyx_v_info->ndim = __pyx_t_7;
11442 
11443  /* "View.MemoryView":546
11444  * info.buf = self.view.buf
11445  * info.ndim = self.view.ndim
11446  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
11447  * info.len = self.view.len
11448  * info.readonly = self.view.readonly
11449  */
11450  __Pyx_TraceLine(546,0,__PYX_ERR(2, 546, __pyx_L1_error))
11451  __pyx_t_8 = __pyx_v_self->view.itemsize;
11452  __pyx_v_info->itemsize = __pyx_t_8;
11453 
11454  /* "View.MemoryView":547
11455  * info.ndim = self.view.ndim
11456  * info.itemsize = self.view.itemsize
11457  * info.len = self.view.len # <<<<<<<<<<<<<<
11458  * info.readonly = self.view.readonly
11459  * info.obj = self
11460  */
11461  __Pyx_TraceLine(547,0,__PYX_ERR(2, 547, __pyx_L1_error))
11462  __pyx_t_8 = __pyx_v_self->view.len;
11463  __pyx_v_info->len = __pyx_t_8;
11464 
11465  /* "View.MemoryView":548
11466  * info.itemsize = self.view.itemsize
11467  * info.len = self.view.len
11468  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
11469  * info.obj = self
11470  *
11471  */
11472  __Pyx_TraceLine(548,0,__PYX_ERR(2, 548, __pyx_L1_error))
11473  __pyx_t_1 = __pyx_v_self->view.readonly;
11474  __pyx_v_info->readonly = __pyx_t_1;
11475 
11476  /* "View.MemoryView":549
11477  * info.len = self.view.len
11478  * info.readonly = self.view.readonly
11479  * info.obj = self # <<<<<<<<<<<<<<
11480  *
11481  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
11482  */
11483  __Pyx_TraceLine(549,0,__PYX_ERR(2, 549, __pyx_L1_error))
11484  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11485  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11486  __Pyx_GOTREF(__pyx_v_info->obj);
11487  __Pyx_DECREF(__pyx_v_info->obj);
11488  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11489 
11490  /* "View.MemoryView":520
11491  *
11492  * @cname('getbuffer')
11493  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11494  * if flags & PyBUF_WRITABLE and self.view.readonly:
11495  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11496  */
11497 
11498  /* function exit code */
11499  __pyx_r = 0;
11500  goto __pyx_L0;
11501  __pyx_L1_error:;
11502  __Pyx_XDECREF(__pyx_t_3);
11503  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11504  __pyx_r = -1;
11505  if (__pyx_v_info->obj != NULL) {
11506  __Pyx_GOTREF(__pyx_v_info->obj);
11507  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11508  }
11509  goto __pyx_L2;
11510  __pyx_L0:;
11511  if (__pyx_v_info->obj == Py_None) {
11512  __Pyx_GOTREF(__pyx_v_info->obj);
11513  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11514  }
11515  __pyx_L2:;
11516  __Pyx_TraceReturn(Py_None, 0);
11517  __Pyx_RefNannyFinishContext();
11518  return __pyx_r;
11519 }
11520 
11521 /* "View.MemoryView":555
11522  *
11523  * @property
11524  * def T(self): # <<<<<<<<<<<<<<
11525  * cdef _memoryviewslice result = memoryview_copy(self)
11526  * transpose_memslice(&result.from_slice)
11527  */
11528 
11529 /* Python wrapper */
11530 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
11531 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11532  PyObject *__pyx_r = 0;
11533  __Pyx_RefNannyDeclarations
11534  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11535  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11536 
11537  /* function exit code */
11538  __Pyx_RefNannyFinishContext();
11539  return __pyx_r;
11540 }
11541 
11542 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11543  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11544  PyObject *__pyx_r = NULL;
11545  __Pyx_TraceDeclarations
11546  __Pyx_RefNannyDeclarations
11547  PyObject *__pyx_t_1 = NULL;
11548  int __pyx_t_2;
11549  int __pyx_lineno = 0;
11550  const char *__pyx_filename = NULL;
11551  int __pyx_clineno = 0;
11552  __Pyx_RefNannySetupContext("__get__", 0);
11553  __Pyx_TraceCall("__get__", __pyx_f[2], 555, 0, __PYX_ERR(2, 555, __pyx_L1_error));
11554 
11555  /* "View.MemoryView":556
11556  * @property
11557  * def T(self):
11558  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
11559  * transpose_memslice(&result.from_slice)
11560  * return result
11561  */
11562  __Pyx_TraceLine(556,0,__PYX_ERR(2, 556, __pyx_L1_error))
11563  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 556, __pyx_L1_error)
11564  __Pyx_GOTREF(__pyx_t_1);
11565  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 556, __pyx_L1_error)
11566  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11567  __pyx_t_1 = 0;
11568 
11569  /* "View.MemoryView":557
11570  * def T(self):
11571  * cdef _memoryviewslice result = memoryview_copy(self)
11572  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
11573  * return result
11574  *
11575  */
11576  __Pyx_TraceLine(557,0,__PYX_ERR(2, 557, __pyx_L1_error))
11577  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 557, __pyx_L1_error)
11578 
11579  /* "View.MemoryView":558
11580  * cdef _memoryviewslice result = memoryview_copy(self)
11581  * transpose_memslice(&result.from_slice)
11582  * return result # <<<<<<<<<<<<<<
11583  *
11584  * @property
11585  */
11586  __Pyx_TraceLine(558,0,__PYX_ERR(2, 558, __pyx_L1_error))
11587  __Pyx_XDECREF(__pyx_r);
11588  __Pyx_INCREF(((PyObject *)__pyx_v_result));
11589  __pyx_r = ((PyObject *)__pyx_v_result);
11590  goto __pyx_L0;
11591 
11592  /* "View.MemoryView":555
11593  *
11594  * @property
11595  * def T(self): # <<<<<<<<<<<<<<
11596  * cdef _memoryviewslice result = memoryview_copy(self)
11597  * transpose_memslice(&result.from_slice)
11598  */
11599 
11600  /* function exit code */
11601  __pyx_L1_error:;
11602  __Pyx_XDECREF(__pyx_t_1);
11603  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11604  __pyx_r = NULL;
11605  __pyx_L0:;
11606  __Pyx_XDECREF((PyObject *)__pyx_v_result);
11607  __Pyx_XGIVEREF(__pyx_r);
11608  __Pyx_TraceReturn(__pyx_r, 0);
11609  __Pyx_RefNannyFinishContext();
11610  return __pyx_r;
11611 }
11612 
11613 /* "View.MemoryView":561
11614  *
11615  * @property
11616  * def base(self): # <<<<<<<<<<<<<<
11617  * return self.obj
11618  *
11619  */
11620 
11621 /* Python wrapper */
11622 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
11623 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11624  PyObject *__pyx_r = 0;
11625  __Pyx_RefNannyDeclarations
11626  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11627  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11628 
11629  /* function exit code */
11630  __Pyx_RefNannyFinishContext();
11631  return __pyx_r;
11632 }
11633 
11634 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11635  PyObject *__pyx_r = NULL;
11636  __Pyx_TraceDeclarations
11637  __Pyx_RefNannyDeclarations
11638  int __pyx_lineno = 0;
11639  const char *__pyx_filename = NULL;
11640  int __pyx_clineno = 0;
11641  __Pyx_RefNannySetupContext("__get__", 0);
11642  __Pyx_TraceCall("__get__", __pyx_f[2], 561, 0, __PYX_ERR(2, 561, __pyx_L1_error));
11643 
11644  /* "View.MemoryView":562
11645  * @property
11646  * def base(self):
11647  * return self.obj # <<<<<<<<<<<<<<
11648  *
11649  * @property
11650  */
11651  __Pyx_TraceLine(562,0,__PYX_ERR(2, 562, __pyx_L1_error))
11652  __Pyx_XDECREF(__pyx_r);
11653  __Pyx_INCREF(__pyx_v_self->obj);
11654  __pyx_r = __pyx_v_self->obj;
11655  goto __pyx_L0;
11656 
11657  /* "View.MemoryView":561
11658  *
11659  * @property
11660  * def base(self): # <<<<<<<<<<<<<<
11661  * return self.obj
11662  *
11663  */
11664 
11665  /* function exit code */
11666  __pyx_L1_error:;
11667  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11668  __pyx_r = NULL;
11669  __pyx_L0:;
11670  __Pyx_XGIVEREF(__pyx_r);
11671  __Pyx_TraceReturn(__pyx_r, 0);
11672  __Pyx_RefNannyFinishContext();
11673  return __pyx_r;
11674 }
11675 
11676 /* "View.MemoryView":565
11677  *
11678  * @property
11679  * def shape(self): # <<<<<<<<<<<<<<
11680  * return tuple([length for length in self.view.shape[:self.view.ndim]])
11681  *
11682  */
11683 
11684 /* Python wrapper */
11685 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
11686 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11687  PyObject *__pyx_r = 0;
11688  __Pyx_RefNannyDeclarations
11689  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11690  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11691 
11692  /* function exit code */
11693  __Pyx_RefNannyFinishContext();
11694  return __pyx_r;
11695 }
11696 
11697 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11698  Py_ssize_t __pyx_v_length;
11699  PyObject *__pyx_r = NULL;
11700  __Pyx_TraceDeclarations
11701  __Pyx_RefNannyDeclarations
11702  PyObject *__pyx_t_1 = NULL;
11703  Py_ssize_t *__pyx_t_2;
11704  Py_ssize_t *__pyx_t_3;
11705  Py_ssize_t *__pyx_t_4;
11706  PyObject *__pyx_t_5 = NULL;
11707  int __pyx_lineno = 0;
11708  const char *__pyx_filename = NULL;
11709  int __pyx_clineno = 0;
11710  __Pyx_RefNannySetupContext("__get__", 0);
11711  __Pyx_TraceCall("__get__", __pyx_f[2], 565, 0, __PYX_ERR(2, 565, __pyx_L1_error));
11712 
11713  /* "View.MemoryView":566
11714  * @property
11715  * def shape(self):
11716  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
11717  *
11718  * @property
11719  */
11720  __Pyx_TraceLine(566,0,__PYX_ERR(2, 566, __pyx_L1_error))
11721  __Pyx_XDECREF(__pyx_r);
11722  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 566, __pyx_L1_error)
11723  __Pyx_GOTREF(__pyx_t_1);
11724  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11725  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11726  __pyx_t_2 = __pyx_t_4;
11727  __pyx_v_length = (__pyx_t_2[0]);
11728  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error)
11729  __Pyx_GOTREF(__pyx_t_5);
11730  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 566, __pyx_L1_error)
11731  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11732  }
11733  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error)
11734  __Pyx_GOTREF(__pyx_t_5);
11735  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11736  __pyx_r = __pyx_t_5;
11737  __pyx_t_5 = 0;
11738  goto __pyx_L0;
11739 
11740  /* "View.MemoryView":565
11741  *
11742  * @property
11743  * def shape(self): # <<<<<<<<<<<<<<
11744  * return tuple([length for length in self.view.shape[:self.view.ndim]])
11745  *
11746  */
11747 
11748  /* function exit code */
11749  __pyx_L1_error:;
11750  __Pyx_XDECREF(__pyx_t_1);
11751  __Pyx_XDECREF(__pyx_t_5);
11752  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11753  __pyx_r = NULL;
11754  __pyx_L0:;
11755  __Pyx_XGIVEREF(__pyx_r);
11756  __Pyx_TraceReturn(__pyx_r, 0);
11757  __Pyx_RefNannyFinishContext();
11758  return __pyx_r;
11759 }
11760 
11761 /* "View.MemoryView":569
11762  *
11763  * @property
11764  * def strides(self): # <<<<<<<<<<<<<<
11765  * if self.view.strides == NULL:
11766  *
11767  */
11768 
11769 /* Python wrapper */
11770 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
11771 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11772  PyObject *__pyx_r = 0;
11773  __Pyx_RefNannyDeclarations
11774  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11775  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11776 
11777  /* function exit code */
11778  __Pyx_RefNannyFinishContext();
11779  return __pyx_r;
11780 }
11781 
11782 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11783  Py_ssize_t __pyx_v_stride;
11784  PyObject *__pyx_r = NULL;
11785  __Pyx_TraceDeclarations
11786  __Pyx_RefNannyDeclarations
11787  int __pyx_t_1;
11788  PyObject *__pyx_t_2 = NULL;
11789  Py_ssize_t *__pyx_t_3;
11790  Py_ssize_t *__pyx_t_4;
11791  Py_ssize_t *__pyx_t_5;
11792  PyObject *__pyx_t_6 = NULL;
11793  int __pyx_lineno = 0;
11794  const char *__pyx_filename = NULL;
11795  int __pyx_clineno = 0;
11796  __Pyx_RefNannySetupContext("__get__", 0);
11797  __Pyx_TraceCall("__get__", __pyx_f[2], 569, 0, __PYX_ERR(2, 569, __pyx_L1_error));
11798 
11799  /* "View.MemoryView":570
11800  * @property
11801  * def strides(self):
11802  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11803  *
11804  * raise ValueError("Buffer view does not expose strides")
11805  */
11806  __Pyx_TraceLine(570,0,__PYX_ERR(2, 570, __pyx_L1_error))
11807  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
11808  if (unlikely(__pyx_t_1)) {
11809 
11810  /* "View.MemoryView":572
11811  * if self.view.strides == NULL:
11812  *
11813  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
11814  *
11815  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11816  */
11817  __Pyx_TraceLine(572,0,__PYX_ERR(2, 572, __pyx_L1_error))
11818  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
11819  __Pyx_GOTREF(__pyx_t_2);
11820  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11821  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11822  __PYX_ERR(2, 572, __pyx_L1_error)
11823 
11824  /* "View.MemoryView":570
11825  * @property
11826  * def strides(self):
11827  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11828  *
11829  * raise ValueError("Buffer view does not expose strides")
11830  */
11831  }
11832 
11833  /* "View.MemoryView":574
11834  * raise ValueError("Buffer view does not expose strides")
11835  *
11836  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
11837  *
11838  * @property
11839  */
11840  __Pyx_TraceLine(574,0,__PYX_ERR(2, 574, __pyx_L1_error))
11841  __Pyx_XDECREF(__pyx_r);
11842  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error)
11843  __Pyx_GOTREF(__pyx_t_2);
11844  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11845  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11846  __pyx_t_3 = __pyx_t_5;
11847  __pyx_v_stride = (__pyx_t_3[0]);
11848  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error)
11849  __Pyx_GOTREF(__pyx_t_6);
11850  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 574, __pyx_L1_error)
11851  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11852  }
11853  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error)
11854  __Pyx_GOTREF(__pyx_t_6);
11855  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11856  __pyx_r = __pyx_t_6;
11857  __pyx_t_6 = 0;
11858  goto __pyx_L0;
11859 
11860  /* "View.MemoryView":569
11861  *
11862  * @property
11863  * def strides(self): # <<<<<<<<<<<<<<
11864  * if self.view.strides == NULL:
11865  *
11866  */
11867 
11868  /* function exit code */
11869  __pyx_L1_error:;
11870  __Pyx_XDECREF(__pyx_t_2);
11871  __Pyx_XDECREF(__pyx_t_6);
11872  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11873  __pyx_r = NULL;
11874  __pyx_L0:;
11875  __Pyx_XGIVEREF(__pyx_r);
11876  __Pyx_TraceReturn(__pyx_r, 0);
11877  __Pyx_RefNannyFinishContext();
11878  return __pyx_r;
11879 }
11880 
11881 /* "View.MemoryView":577
11882  *
11883  * @property
11884  * def suboffsets(self): # <<<<<<<<<<<<<<
11885  * if self.view.suboffsets == NULL:
11886  * return (-1,) * self.view.ndim
11887  */
11888 
11889 /* Python wrapper */
11890 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
11891 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11892  PyObject *__pyx_r = 0;
11893  __Pyx_RefNannyDeclarations
11894  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11895  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11896 
11897  /* function exit code */
11898  __Pyx_RefNannyFinishContext();
11899  return __pyx_r;
11900 }
11901 
11902 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11903  Py_ssize_t __pyx_v_suboffset;
11904  PyObject *__pyx_r = NULL;
11905  __Pyx_TraceDeclarations
11906  __Pyx_RefNannyDeclarations
11907  int __pyx_t_1;
11908  PyObject *__pyx_t_2 = NULL;
11909  PyObject *__pyx_t_3 = NULL;
11910  Py_ssize_t *__pyx_t_4;
11911  Py_ssize_t *__pyx_t_5;
11912  Py_ssize_t *__pyx_t_6;
11913  int __pyx_lineno = 0;
11914  const char *__pyx_filename = NULL;
11915  int __pyx_clineno = 0;
11916  __Pyx_RefNannySetupContext("__get__", 0);
11917  __Pyx_TraceCall("__get__", __pyx_f[2], 577, 0, __PYX_ERR(2, 577, __pyx_L1_error));
11918 
11919  /* "View.MemoryView":578
11920  * @property
11921  * def suboffsets(self):
11922  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11923  * return (-1,) * self.view.ndim
11924  *
11925  */
11926  __Pyx_TraceLine(578,0,__PYX_ERR(2, 578, __pyx_L1_error))
11927  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
11928  if (__pyx_t_1) {
11929 
11930  /* "View.MemoryView":579
11931  * def suboffsets(self):
11932  * if self.view.suboffsets == NULL:
11933  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
11934  *
11935  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11936  */
11937  __Pyx_TraceLine(579,0,__PYX_ERR(2, 579, __pyx_L1_error))
11938  __Pyx_XDECREF(__pyx_r);
11939  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
11940  __Pyx_GOTREF(__pyx_t_2);
11941  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
11942  __Pyx_GOTREF(__pyx_t_3);
11943  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11944  __pyx_r = __pyx_t_3;
11945  __pyx_t_3 = 0;
11946  goto __pyx_L0;
11947 
11948  /* "View.MemoryView":578
11949  * @property
11950  * def suboffsets(self):
11951  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11952  * return (-1,) * self.view.ndim
11953  *
11954  */
11955  }
11956 
11957  /* "View.MemoryView":581
11958  * return (-1,) * self.view.ndim
11959  *
11960  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
11961  *
11962  * @property
11963  */
11964  __Pyx_TraceLine(581,0,__PYX_ERR(2, 581, __pyx_L1_error))
11965  __Pyx_XDECREF(__pyx_r);
11966  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 581, __pyx_L1_error)
11967  __Pyx_GOTREF(__pyx_t_3);
11968  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11969  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11970  __pyx_t_4 = __pyx_t_6;
11971  __pyx_v_suboffset = (__pyx_t_4[0]);
11972  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error)
11973  __Pyx_GOTREF(__pyx_t_2);
11974  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 581, __pyx_L1_error)
11975  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11976  }
11977  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error)
11978  __Pyx_GOTREF(__pyx_t_2);
11979  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11980  __pyx_r = __pyx_t_2;
11981  __pyx_t_2 = 0;
11982  goto __pyx_L0;
11983 
11984  /* "View.MemoryView":577
11985  *
11986  * @property
11987  * def suboffsets(self): # <<<<<<<<<<<<<<
11988  * if self.view.suboffsets == NULL:
11989  * return (-1,) * self.view.ndim
11990  */
11991 
11992  /* function exit code */
11993  __pyx_L1_error:;
11994  __Pyx_XDECREF(__pyx_t_2);
11995  __Pyx_XDECREF(__pyx_t_3);
11996  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11997  __pyx_r = NULL;
11998  __pyx_L0:;
11999  __Pyx_XGIVEREF(__pyx_r);
12000  __Pyx_TraceReturn(__pyx_r, 0);
12001  __Pyx_RefNannyFinishContext();
12002  return __pyx_r;
12003 }
12004 
12005 /* "View.MemoryView":584
12006  *
12007  * @property
12008  * def ndim(self): # <<<<<<<<<<<<<<
12009  * return self.view.ndim
12010  *
12011  */
12012 
12013 /* Python wrapper */
12014 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
12015 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12016  PyObject *__pyx_r = 0;
12017  __Pyx_RefNannyDeclarations
12018  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12019  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12020 
12021  /* function exit code */
12022  __Pyx_RefNannyFinishContext();
12023  return __pyx_r;
12024 }
12025 
12026 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12027  PyObject *__pyx_r = NULL;
12028  __Pyx_TraceDeclarations
12029  __Pyx_RefNannyDeclarations
12030  PyObject *__pyx_t_1 = NULL;
12031  int __pyx_lineno = 0;
12032  const char *__pyx_filename = NULL;
12033  int __pyx_clineno = 0;
12034  __Pyx_RefNannySetupContext("__get__", 0);
12035  __Pyx_TraceCall("__get__", __pyx_f[2], 584, 0, __PYX_ERR(2, 584, __pyx_L1_error));
12036 
12037  /* "View.MemoryView":585
12038  * @property
12039  * def ndim(self):
12040  * return self.view.ndim # <<<<<<<<<<<<<<
12041  *
12042  * @property
12043  */
12044  __Pyx_TraceLine(585,0,__PYX_ERR(2, 585, __pyx_L1_error))
12045  __Pyx_XDECREF(__pyx_r);
12046  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 585, __pyx_L1_error)
12047  __Pyx_GOTREF(__pyx_t_1);
12048  __pyx_r = __pyx_t_1;
12049  __pyx_t_1 = 0;
12050  goto __pyx_L0;
12051 
12052  /* "View.MemoryView":584
12053  *
12054  * @property
12055  * def ndim(self): # <<<<<<<<<<<<<<
12056  * return self.view.ndim
12057  *
12058  */
12059 
12060  /* function exit code */
12061  __pyx_L1_error:;
12062  __Pyx_XDECREF(__pyx_t_1);
12063  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12064  __pyx_r = NULL;
12065  __pyx_L0:;
12066  __Pyx_XGIVEREF(__pyx_r);
12067  __Pyx_TraceReturn(__pyx_r, 0);
12068  __Pyx_RefNannyFinishContext();
12069  return __pyx_r;
12070 }
12071 
12072 /* "View.MemoryView":588
12073  *
12074  * @property
12075  * def itemsize(self): # <<<<<<<<<<<<<<
12076  * return self.view.itemsize
12077  *
12078  */
12079 
12080 /* Python wrapper */
12081 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
12082 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12083  PyObject *__pyx_r = 0;
12084  __Pyx_RefNannyDeclarations
12085  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12086  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12087 
12088  /* function exit code */
12089  __Pyx_RefNannyFinishContext();
12090  return __pyx_r;
12091 }
12092 
12093 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12094  PyObject *__pyx_r = NULL;
12095  __Pyx_TraceDeclarations
12096  __Pyx_RefNannyDeclarations
12097  PyObject *__pyx_t_1 = NULL;
12098  int __pyx_lineno = 0;
12099  const char *__pyx_filename = NULL;
12100  int __pyx_clineno = 0;
12101  __Pyx_RefNannySetupContext("__get__", 0);
12102  __Pyx_TraceCall("__get__", __pyx_f[2], 588, 0, __PYX_ERR(2, 588, __pyx_L1_error));
12103 
12104  /* "View.MemoryView":589
12105  * @property
12106  * def itemsize(self):
12107  * return self.view.itemsize # <<<<<<<<<<<<<<
12108  *
12109  * @property
12110  */
12111  __Pyx_TraceLine(589,0,__PYX_ERR(2, 589, __pyx_L1_error))
12112  __Pyx_XDECREF(__pyx_r);
12113  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 589, __pyx_L1_error)
12114  __Pyx_GOTREF(__pyx_t_1);
12115  __pyx_r = __pyx_t_1;
12116  __pyx_t_1 = 0;
12117  goto __pyx_L0;
12118 
12119  /* "View.MemoryView":588
12120  *
12121  * @property
12122  * def itemsize(self): # <<<<<<<<<<<<<<
12123  * return self.view.itemsize
12124  *
12125  */
12126 
12127  /* function exit code */
12128  __pyx_L1_error:;
12129  __Pyx_XDECREF(__pyx_t_1);
12130  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12131  __pyx_r = NULL;
12132  __pyx_L0:;
12133  __Pyx_XGIVEREF(__pyx_r);
12134  __Pyx_TraceReturn(__pyx_r, 0);
12135  __Pyx_RefNannyFinishContext();
12136  return __pyx_r;
12137 }
12138 
12139 /* "View.MemoryView":592
12140  *
12141  * @property
12142  * def nbytes(self): # <<<<<<<<<<<<<<
12143  * return self.size * self.view.itemsize
12144  *
12145  */
12146 
12147 /* Python wrapper */
12148 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
12149 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12150  PyObject *__pyx_r = 0;
12151  __Pyx_RefNannyDeclarations
12152  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12153  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12154 
12155  /* function exit code */
12156  __Pyx_RefNannyFinishContext();
12157  return __pyx_r;
12158 }
12159 
12160 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12161  PyObject *__pyx_r = NULL;
12162  __Pyx_TraceDeclarations
12163  __Pyx_RefNannyDeclarations
12164  PyObject *__pyx_t_1 = NULL;
12165  PyObject *__pyx_t_2 = NULL;
12166  PyObject *__pyx_t_3 = NULL;
12167  int __pyx_lineno = 0;
12168  const char *__pyx_filename = NULL;
12169  int __pyx_clineno = 0;
12170  __Pyx_RefNannySetupContext("__get__", 0);
12171  __Pyx_TraceCall("__get__", __pyx_f[2], 592, 0, __PYX_ERR(2, 592, __pyx_L1_error));
12172 
12173  /* "View.MemoryView":593
12174  * @property
12175  * def nbytes(self):
12176  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
12177  *
12178  * @property
12179  */
12180  __Pyx_TraceLine(593,0,__PYX_ERR(2, 593, __pyx_L1_error))
12181  __Pyx_XDECREF(__pyx_r);
12182  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 593, __pyx_L1_error)
12183  __Pyx_GOTREF(__pyx_t_1);
12184  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 593, __pyx_L1_error)
12185  __Pyx_GOTREF(__pyx_t_2);
12186  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 593, __pyx_L1_error)
12187  __Pyx_GOTREF(__pyx_t_3);
12188  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12189  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12190  __pyx_r = __pyx_t_3;
12191  __pyx_t_3 = 0;
12192  goto __pyx_L0;
12193 
12194  /* "View.MemoryView":592
12195  *
12196  * @property
12197  * def nbytes(self): # <<<<<<<<<<<<<<
12198  * return self.size * self.view.itemsize
12199  *
12200  */
12201 
12202  /* function exit code */
12203  __pyx_L1_error:;
12204  __Pyx_XDECREF(__pyx_t_1);
12205  __Pyx_XDECREF(__pyx_t_2);
12206  __Pyx_XDECREF(__pyx_t_3);
12207  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12208  __pyx_r = NULL;
12209  __pyx_L0:;
12210  __Pyx_XGIVEREF(__pyx_r);
12211  __Pyx_TraceReturn(__pyx_r, 0);
12212  __Pyx_RefNannyFinishContext();
12213  return __pyx_r;
12214 }
12215 
12216 /* "View.MemoryView":596
12217  *
12218  * @property
12219  * def size(self): # <<<<<<<<<<<<<<
12220  * if self._size is None:
12221  * result = 1
12222  */
12223 
12224 /* Python wrapper */
12225 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
12226 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12227  PyObject *__pyx_r = 0;
12228  __Pyx_RefNannyDeclarations
12229  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12230  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12231 
12232  /* function exit code */
12233  __Pyx_RefNannyFinishContext();
12234  return __pyx_r;
12235 }
12236 
12237 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12238  PyObject *__pyx_v_result = NULL;
12239  PyObject *__pyx_v_length = NULL;
12240  PyObject *__pyx_r = NULL;
12241  __Pyx_TraceDeclarations
12242  __Pyx_RefNannyDeclarations
12243  int __pyx_t_1;
12244  int __pyx_t_2;
12245  Py_ssize_t *__pyx_t_3;
12246  Py_ssize_t *__pyx_t_4;
12247  Py_ssize_t *__pyx_t_5;
12248  PyObject *__pyx_t_6 = NULL;
12249  int __pyx_lineno = 0;
12250  const char *__pyx_filename = NULL;
12251  int __pyx_clineno = 0;
12252  __Pyx_RefNannySetupContext("__get__", 0);
12253  __Pyx_TraceCall("__get__", __pyx_f[2], 596, 0, __PYX_ERR(2, 596, __pyx_L1_error));
12254 
12255  /* "View.MemoryView":597
12256  * @property
12257  * def size(self):
12258  * if self._size is None: # <<<<<<<<<<<<<<
12259  * result = 1
12260  *
12261  */
12262  __Pyx_TraceLine(597,0,__PYX_ERR(2, 597, __pyx_L1_error))
12263  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12264  __pyx_t_2 = (__pyx_t_1 != 0);
12265  if (__pyx_t_2) {
12266 
12267  /* "View.MemoryView":598
12268  * def size(self):
12269  * if self._size is None:
12270  * result = 1 # <<<<<<<<<<<<<<
12271  *
12272  * for length in self.view.shape[:self.view.ndim]:
12273  */
12274  __Pyx_TraceLine(598,0,__PYX_ERR(2, 598, __pyx_L1_error))
12275  __Pyx_INCREF(__pyx_int_1);
12276  __pyx_v_result = __pyx_int_1;
12277 
12278  /* "View.MemoryView":600
12279  * result = 1
12280  *
12281  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
12282  * result *= length
12283  *
12284  */
12285  __Pyx_TraceLine(600,0,__PYX_ERR(2, 600, __pyx_L1_error))
12286  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12287  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12288  __pyx_t_3 = __pyx_t_5;
12289  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 600, __pyx_L1_error)
12290  __Pyx_GOTREF(__pyx_t_6);
12291  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12292  __pyx_t_6 = 0;
12293 
12294  /* "View.MemoryView":601
12295  *
12296  * for length in self.view.shape[:self.view.ndim]:
12297  * result *= length # <<<<<<<<<<<<<<
12298  *
12299  * self._size = result
12300  */
12301  __Pyx_TraceLine(601,0,__PYX_ERR(2, 601, __pyx_L1_error))
12302  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 601, __pyx_L1_error)
12303  __Pyx_GOTREF(__pyx_t_6);
12304  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12305  __pyx_t_6 = 0;
12306  }
12307 
12308  /* "View.MemoryView":603
12309  * result *= length
12310  *
12311  * self._size = result # <<<<<<<<<<<<<<
12312  *
12313  * return self._size
12314  */
12315  __Pyx_TraceLine(603,0,__PYX_ERR(2, 603, __pyx_L1_error))
12316  __Pyx_INCREF(__pyx_v_result);
12317  __Pyx_GIVEREF(__pyx_v_result);
12318  __Pyx_GOTREF(__pyx_v_self->_size);
12319  __Pyx_DECREF(__pyx_v_self->_size);
12320  __pyx_v_self->_size = __pyx_v_result;
12321 
12322  /* "View.MemoryView":597
12323  * @property
12324  * def size(self):
12325  * if self._size is None: # <<<<<<<<<<<<<<
12326  * result = 1
12327  *
12328  */
12329  }
12330 
12331  /* "View.MemoryView":605
12332  * self._size = result
12333  *
12334  * return self._size # <<<<<<<<<<<<<<
12335  *
12336  * def __len__(self):
12337  */
12338  __Pyx_TraceLine(605,0,__PYX_ERR(2, 605, __pyx_L1_error))
12339  __Pyx_XDECREF(__pyx_r);
12340  __Pyx_INCREF(__pyx_v_self->_size);
12341  __pyx_r = __pyx_v_self->_size;
12342  goto __pyx_L0;
12343 
12344  /* "View.MemoryView":596
12345  *
12346  * @property
12347  * def size(self): # <<<<<<<<<<<<<<
12348  * if self._size is None:
12349  * result = 1
12350  */
12351 
12352  /* function exit code */
12353  __pyx_L1_error:;
12354  __Pyx_XDECREF(__pyx_t_6);
12355  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12356  __pyx_r = NULL;
12357  __pyx_L0:;
12358  __Pyx_XDECREF(__pyx_v_result);
12359  __Pyx_XDECREF(__pyx_v_length);
12360  __Pyx_XGIVEREF(__pyx_r);
12361  __Pyx_TraceReturn(__pyx_r, 0);
12362  __Pyx_RefNannyFinishContext();
12363  return __pyx_r;
12364 }
12365 
12366 /* "View.MemoryView":607
12367  * return self._size
12368  *
12369  * def __len__(self): # <<<<<<<<<<<<<<
12370  * if self.view.ndim >= 1:
12371  * return self.view.shape[0]
12372  */
12373 
12374 /* Python wrapper */
12375 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
12376 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12377  Py_ssize_t __pyx_r;
12378  __Pyx_RefNannyDeclarations
12379  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12380  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12381 
12382  /* function exit code */
12383  __Pyx_RefNannyFinishContext();
12384  return __pyx_r;
12385 }
12386 
12387 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
12388  Py_ssize_t __pyx_r;
12389  __Pyx_TraceDeclarations
12390  __Pyx_RefNannyDeclarations
12391  int __pyx_t_1;
12392  int __pyx_lineno = 0;
12393  const char *__pyx_filename = NULL;
12394  int __pyx_clineno = 0;
12395  __Pyx_RefNannySetupContext("__len__", 0);
12396  __Pyx_TraceCall("__len__", __pyx_f[2], 607, 0, __PYX_ERR(2, 607, __pyx_L1_error));
12397 
12398  /* "View.MemoryView":608
12399  *
12400  * def __len__(self):
12401  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12402  * return self.view.shape[0]
12403  *
12404  */
12405  __Pyx_TraceLine(608,0,__PYX_ERR(2, 608, __pyx_L1_error))
12406  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
12407  if (__pyx_t_1) {
12408 
12409  /* "View.MemoryView":609
12410  * def __len__(self):
12411  * if self.view.ndim >= 1:
12412  * return self.view.shape[0] # <<<<<<<<<<<<<<
12413  *
12414  * return 0
12415  */
12416  __Pyx_TraceLine(609,0,__PYX_ERR(2, 609, __pyx_L1_error))
12417  __pyx_r = (__pyx_v_self->view.shape[0]);
12418  goto __pyx_L0;
12419 
12420  /* "View.MemoryView":608
12421  *
12422  * def __len__(self):
12423  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12424  * return self.view.shape[0]
12425  *
12426  */
12427  }
12428 
12429  /* "View.MemoryView":611
12430  * return self.view.shape[0]
12431  *
12432  * return 0 # <<<<<<<<<<<<<<
12433  *
12434  * def __repr__(self):
12435  */
12436  __Pyx_TraceLine(611,0,__PYX_ERR(2, 611, __pyx_L1_error))
12437  __pyx_r = 0;
12438  goto __pyx_L0;
12439 
12440  /* "View.MemoryView":607
12441  * return self._size
12442  *
12443  * def __len__(self): # <<<<<<<<<<<<<<
12444  * if self.view.ndim >= 1:
12445  * return self.view.shape[0]
12446  */
12447 
12448  /* function exit code */
12449  __pyx_L1_error:;
12450  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12451  __pyx_r = -1;
12452  __pyx_L0:;
12453  __Pyx_TraceReturn(Py_None, 0);
12454  __Pyx_RefNannyFinishContext();
12455  return __pyx_r;
12456 }
12457 
12458 /* "View.MemoryView":613
12459  * return 0
12460  *
12461  * def __repr__(self): # <<<<<<<<<<<<<<
12462  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12463  * id(self))
12464  */
12465 
12466 /* Python wrapper */
12467 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
12468 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12469  PyObject *__pyx_r = 0;
12470  __Pyx_RefNannyDeclarations
12471  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
12472  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12473 
12474  /* function exit code */
12475  __Pyx_RefNannyFinishContext();
12476  return __pyx_r;
12477 }
12478 
12479 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
12480  PyObject *__pyx_r = NULL;
12481  __Pyx_TraceDeclarations
12482  __Pyx_RefNannyDeclarations
12483  PyObject *__pyx_t_1 = NULL;
12484  PyObject *__pyx_t_2 = NULL;
12485  PyObject *__pyx_t_3 = NULL;
12486  int __pyx_lineno = 0;
12487  const char *__pyx_filename = NULL;
12488  int __pyx_clineno = 0;
12489  __Pyx_RefNannySetupContext("__repr__", 0);
12490  __Pyx_TraceCall("__repr__", __pyx_f[2], 613, 0, __PYX_ERR(2, 613, __pyx_L1_error));
12491 
12492  /* "View.MemoryView":614
12493  *
12494  * def __repr__(self):
12495  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12496  * id(self))
12497  *
12498  */
12499  __Pyx_TraceLine(614,0,__PYX_ERR(2, 614, __pyx_L1_error))
12500  __Pyx_XDECREF(__pyx_r);
12501  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error)
12502  __Pyx_GOTREF(__pyx_t_1);
12503  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error)
12504  __Pyx_GOTREF(__pyx_t_2);
12505  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12506  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error)
12507  __Pyx_GOTREF(__pyx_t_1);
12508  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12509 
12510  /* "View.MemoryView":615
12511  * def __repr__(self):
12512  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12513  * id(self)) # <<<<<<<<<<<<<<
12514  *
12515  * def __str__(self):
12516  */
12517  __Pyx_TraceLine(615,0,__PYX_ERR(2, 615, __pyx_L1_error))
12518  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 615, __pyx_L1_error)
12519  __Pyx_GOTREF(__pyx_t_2);
12520 
12521  /* "View.MemoryView":614
12522  *
12523  * def __repr__(self):
12524  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12525  * id(self))
12526  *
12527  */
12528  __Pyx_TraceLine(614,0,__PYX_ERR(2, 614, __pyx_L1_error))
12529  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 614, __pyx_L1_error)
12530  __Pyx_GOTREF(__pyx_t_3);
12531  __Pyx_GIVEREF(__pyx_t_1);
12532  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
12533  __Pyx_GIVEREF(__pyx_t_2);
12534  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12535  __pyx_t_1 = 0;
12536  __pyx_t_2 = 0;
12537  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error)
12538  __Pyx_GOTREF(__pyx_t_2);
12539  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12540  __pyx_r = __pyx_t_2;
12541  __pyx_t_2 = 0;
12542  goto __pyx_L0;
12543 
12544  /* "View.MemoryView":613
12545  * return 0
12546  *
12547  * def __repr__(self): # <<<<<<<<<<<<<<
12548  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12549  * id(self))
12550  */
12551 
12552  /* function exit code */
12553  __pyx_L1_error:;
12554  __Pyx_XDECREF(__pyx_t_1);
12555  __Pyx_XDECREF(__pyx_t_2);
12556  __Pyx_XDECREF(__pyx_t_3);
12557  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12558  __pyx_r = NULL;
12559  __pyx_L0:;
12560  __Pyx_XGIVEREF(__pyx_r);
12561  __Pyx_TraceReturn(__pyx_r, 0);
12562  __Pyx_RefNannyFinishContext();
12563  return __pyx_r;
12564 }
12565 
12566 /* "View.MemoryView":617
12567  * id(self))
12568  *
12569  * def __str__(self): # <<<<<<<<<<<<<<
12570  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12571  *
12572  */
12573 
12574 /* Python wrapper */
12575 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
12576 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12577  PyObject *__pyx_r = 0;
12578  __Pyx_RefNannyDeclarations
12579  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
12580  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12581 
12582  /* function exit code */
12583  __Pyx_RefNannyFinishContext();
12584  return __pyx_r;
12585 }
12586 
12587 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
12588  PyObject *__pyx_r = NULL;
12589  __Pyx_TraceDeclarations
12590  __Pyx_RefNannyDeclarations
12591  PyObject *__pyx_t_1 = NULL;
12592  PyObject *__pyx_t_2 = NULL;
12593  int __pyx_lineno = 0;
12594  const char *__pyx_filename = NULL;
12595  int __pyx_clineno = 0;
12596  __Pyx_RefNannySetupContext("__str__", 0);
12597  __Pyx_TraceCall("__str__", __pyx_f[2], 617, 0, __PYX_ERR(2, 617, __pyx_L1_error));
12598 
12599  /* "View.MemoryView":618
12600  *
12601  * def __str__(self):
12602  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
12603  *
12604  *
12605  */
12606  __Pyx_TraceLine(618,0,__PYX_ERR(2, 618, __pyx_L1_error))
12607  __Pyx_XDECREF(__pyx_r);
12608  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
12609  __Pyx_GOTREF(__pyx_t_1);
12610  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error)
12611  __Pyx_GOTREF(__pyx_t_2);
12612  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12613  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
12614  __Pyx_GOTREF(__pyx_t_1);
12615  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12616  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error)
12617  __Pyx_GOTREF(__pyx_t_2);
12618  __Pyx_GIVEREF(__pyx_t_1);
12619  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12620  __pyx_t_1 = 0;
12621  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
12622  __Pyx_GOTREF(__pyx_t_1);
12623  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12624  __pyx_r = __pyx_t_1;
12625  __pyx_t_1 = 0;
12626  goto __pyx_L0;
12627 
12628  /* "View.MemoryView":617
12629  * id(self))
12630  *
12631  * def __str__(self): # <<<<<<<<<<<<<<
12632  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12633  *
12634  */
12635 
12636  /* function exit code */
12637  __pyx_L1_error:;
12638  __Pyx_XDECREF(__pyx_t_1);
12639  __Pyx_XDECREF(__pyx_t_2);
12640  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12641  __pyx_r = NULL;
12642  __pyx_L0:;
12643  __Pyx_XGIVEREF(__pyx_r);
12644  __Pyx_TraceReturn(__pyx_r, 0);
12645  __Pyx_RefNannyFinishContext();
12646  return __pyx_r;
12647 }
12648 
12649 /* "View.MemoryView":621
12650  *
12651  *
12652  * def is_c_contig(self): # <<<<<<<<<<<<<<
12653  * cdef __Pyx_memviewslice *mslice
12654  * cdef __Pyx_memviewslice tmp
12655  */
12656 
12657 /* Python wrapper */
12658 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12659 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
12660 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12661  PyObject *__pyx_r = 0;
12662  __Pyx_RefNannyDeclarations
12663  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12664  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12665 
12666  /* function exit code */
12667  __Pyx_RefNannyFinishContext();
12668  return __pyx_r;
12669 }
12670 
12671 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12672  __Pyx_memviewslice *__pyx_v_mslice;
12673  __Pyx_memviewslice __pyx_v_tmp;
12674  PyObject *__pyx_r = NULL;
12675  __Pyx_TraceDeclarations
12676  __Pyx_RefNannyDeclarations
12677  __Pyx_memviewslice *__pyx_t_1;
12678  PyObject *__pyx_t_2 = NULL;
12679  int __pyx_lineno = 0;
12680  const char *__pyx_filename = NULL;
12681  int __pyx_clineno = 0;
12682  __Pyx_RefNannySetupContext("is_c_contig", 0);
12683  __Pyx_TraceCall("is_c_contig", __pyx_f[2], 621, 0, __PYX_ERR(2, 621, __pyx_L1_error));
12684 
12685  /* "View.MemoryView":624
12686  * cdef __Pyx_memviewslice *mslice
12687  * cdef __Pyx_memviewslice tmp
12688  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12689  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12690  *
12691  */
12692  __Pyx_TraceLine(624,0,__PYX_ERR(2, 624, __pyx_L1_error))
12693  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 624, __pyx_L1_error)
12694  __pyx_v_mslice = __pyx_t_1;
12695 
12696  /* "View.MemoryView":625
12697  * cdef __Pyx_memviewslice tmp
12698  * mslice = get_slice_from_memview(self, &tmp)
12699  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
12700  *
12701  * def is_f_contig(self):
12702  */
12703  __Pyx_TraceLine(625,0,__PYX_ERR(2, 625, __pyx_L1_error))
12704  __Pyx_XDECREF(__pyx_r);
12705  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 625, __pyx_L1_error)
12706  __Pyx_GOTREF(__pyx_t_2);
12707  __pyx_r = __pyx_t_2;
12708  __pyx_t_2 = 0;
12709  goto __pyx_L0;
12710 
12711  /* "View.MemoryView":621
12712  *
12713  *
12714  * def is_c_contig(self): # <<<<<<<<<<<<<<
12715  * cdef __Pyx_memviewslice *mslice
12716  * cdef __Pyx_memviewslice tmp
12717  */
12718 
12719  /* function exit code */
12720  __pyx_L1_error:;
12721  __Pyx_XDECREF(__pyx_t_2);
12722  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12723  __pyx_r = NULL;
12724  __pyx_L0:;
12725  __Pyx_XGIVEREF(__pyx_r);
12726  __Pyx_TraceReturn(__pyx_r, 0);
12727  __Pyx_RefNannyFinishContext();
12728  return __pyx_r;
12729 }
12730 
12731 /* "View.MemoryView":627
12732  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12733  *
12734  * def is_f_contig(self): # <<<<<<<<<<<<<<
12735  * cdef __Pyx_memviewslice *mslice
12736  * cdef __Pyx_memviewslice tmp
12737  */
12738 
12739 /* Python wrapper */
12740 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12741 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
12742 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12743  PyObject *__pyx_r = 0;
12744  __Pyx_RefNannyDeclarations
12745  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12746  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12747 
12748  /* function exit code */
12749  __Pyx_RefNannyFinishContext();
12750  return __pyx_r;
12751 }
12752 
12753 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12754  __Pyx_memviewslice *__pyx_v_mslice;
12755  __Pyx_memviewslice __pyx_v_tmp;
12756  PyObject *__pyx_r = NULL;
12757  __Pyx_TraceDeclarations
12758  __Pyx_RefNannyDeclarations
12759  __Pyx_memviewslice *__pyx_t_1;
12760  PyObject *__pyx_t_2 = NULL;
12761  int __pyx_lineno = 0;
12762  const char *__pyx_filename = NULL;
12763  int __pyx_clineno = 0;
12764  __Pyx_RefNannySetupContext("is_f_contig", 0);
12765  __Pyx_TraceCall("is_f_contig", __pyx_f[2], 627, 0, __PYX_ERR(2, 627, __pyx_L1_error));
12766 
12767  /* "View.MemoryView":630
12768  * cdef __Pyx_memviewslice *mslice
12769  * cdef __Pyx_memviewslice tmp
12770  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12771  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12772  *
12773  */
12774  __Pyx_TraceLine(630,0,__PYX_ERR(2, 630, __pyx_L1_error))
12775  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 630, __pyx_L1_error)
12776  __pyx_v_mslice = __pyx_t_1;
12777 
12778  /* "View.MemoryView":631
12779  * cdef __Pyx_memviewslice tmp
12780  * mslice = get_slice_from_memview(self, &tmp)
12781  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
12782  *
12783  * def copy(self):
12784  */
12785  __Pyx_TraceLine(631,0,__PYX_ERR(2, 631, __pyx_L1_error))
12786  __Pyx_XDECREF(__pyx_r);
12787  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 631, __pyx_L1_error)
12788  __Pyx_GOTREF(__pyx_t_2);
12789  __pyx_r = __pyx_t_2;
12790  __pyx_t_2 = 0;
12791  goto __pyx_L0;
12792 
12793  /* "View.MemoryView":627
12794  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12795  *
12796  * def is_f_contig(self): # <<<<<<<<<<<<<<
12797  * cdef __Pyx_memviewslice *mslice
12798  * cdef __Pyx_memviewslice tmp
12799  */
12800 
12801  /* function exit code */
12802  __pyx_L1_error:;
12803  __Pyx_XDECREF(__pyx_t_2);
12804  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12805  __pyx_r = NULL;
12806  __pyx_L0:;
12807  __Pyx_XGIVEREF(__pyx_r);
12808  __Pyx_TraceReturn(__pyx_r, 0);
12809  __Pyx_RefNannyFinishContext();
12810  return __pyx_r;
12811 }
12812 
12813 /* "View.MemoryView":633
12814  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12815  *
12816  * def copy(self): # <<<<<<<<<<<<<<
12817  * cdef __Pyx_memviewslice mslice
12818  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12819  */
12820 
12821 /* Python wrapper */
12822 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12823 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
12824 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12825  PyObject *__pyx_r = 0;
12826  __Pyx_RefNannyDeclarations
12827  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12828  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12829 
12830  /* function exit code */
12831  __Pyx_RefNannyFinishContext();
12832  return __pyx_r;
12833 }
12834 
12835 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12836  __Pyx_memviewslice __pyx_v_mslice;
12837  int __pyx_v_flags;
12838  PyObject *__pyx_r = NULL;
12839  __Pyx_TraceDeclarations
12840  __Pyx_RefNannyDeclarations
12841  __Pyx_memviewslice __pyx_t_1;
12842  PyObject *__pyx_t_2 = NULL;
12843  int __pyx_lineno = 0;
12844  const char *__pyx_filename = NULL;
12845  int __pyx_clineno = 0;
12846  __Pyx_RefNannySetupContext("copy", 0);
12847  __Pyx_TraceCall("copy", __pyx_f[2], 633, 0, __PYX_ERR(2, 633, __pyx_L1_error));
12848 
12849  /* "View.MemoryView":635
12850  * def copy(self):
12851  * cdef __Pyx_memviewslice mslice
12852  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12853  *
12854  * slice_copy(self, &mslice)
12855  */
12856  __Pyx_TraceLine(635,0,__PYX_ERR(2, 635, __pyx_L1_error))
12857  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12858 
12859  /* "View.MemoryView":637
12860  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12861  *
12862  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12863  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12864  * self.view.itemsize,
12865  */
12866  __Pyx_TraceLine(637,0,__PYX_ERR(2, 637, __pyx_L1_error))
12867  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12868 
12869  /* "View.MemoryView":638
12870  *
12871  * slice_copy(self, &mslice)
12872  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12873  * self.view.itemsize,
12874  * flags|PyBUF_C_CONTIGUOUS,
12875  */
12876  __Pyx_TraceLine(638,0,__PYX_ERR(2, 638, __pyx_L1_error))
12877  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error)
12878  __pyx_v_mslice = __pyx_t_1;
12879 
12880  /* "View.MemoryView":643
12881  * self.dtype_is_object)
12882  *
12883  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12884  *
12885  * def copy_fortran(self):
12886  */
12887  __Pyx_TraceLine(643,0,__PYX_ERR(2, 643, __pyx_L1_error))
12888  __Pyx_XDECREF(__pyx_r);
12889  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 643, __pyx_L1_error)
12890  __Pyx_GOTREF(__pyx_t_2);
12891  __pyx_r = __pyx_t_2;
12892  __pyx_t_2 = 0;
12893  goto __pyx_L0;
12894 
12895  /* "View.MemoryView":633
12896  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12897  *
12898  * def copy(self): # <<<<<<<<<<<<<<
12899  * cdef __Pyx_memviewslice mslice
12900  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12901  */
12902 
12903  /* function exit code */
12904  __pyx_L1_error:;
12905  __Pyx_XDECREF(__pyx_t_2);
12906  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12907  __pyx_r = NULL;
12908  __pyx_L0:;
12909  __Pyx_XGIVEREF(__pyx_r);
12910  __Pyx_TraceReturn(__pyx_r, 0);
12911  __Pyx_RefNannyFinishContext();
12912  return __pyx_r;
12913 }
12914 
12915 /* "View.MemoryView":645
12916  * return memoryview_copy_from_slice(self, &mslice)
12917  *
12918  * def copy_fortran(self): # <<<<<<<<<<<<<<
12919  * cdef __Pyx_memviewslice src, dst
12920  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12921  */
12922 
12923 /* Python wrapper */
12924 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12925 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
12926 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12927  PyObject *__pyx_r = 0;
12928  __Pyx_RefNannyDeclarations
12929  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12930  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12931 
12932  /* function exit code */
12933  __Pyx_RefNannyFinishContext();
12934  return __pyx_r;
12935 }
12936 
12937 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12938  __Pyx_memviewslice __pyx_v_src;
12939  __Pyx_memviewslice __pyx_v_dst;
12940  int __pyx_v_flags;
12941  PyObject *__pyx_r = NULL;
12942  __Pyx_TraceDeclarations
12943  __Pyx_RefNannyDeclarations
12944  __Pyx_memviewslice __pyx_t_1;
12945  PyObject *__pyx_t_2 = NULL;
12946  int __pyx_lineno = 0;
12947  const char *__pyx_filename = NULL;
12948  int __pyx_clineno = 0;
12949  __Pyx_RefNannySetupContext("copy_fortran", 0);
12950  __Pyx_TraceCall("copy_fortran", __pyx_f[2], 645, 0, __PYX_ERR(2, 645, __pyx_L1_error));
12951 
12952  /* "View.MemoryView":647
12953  * def copy_fortran(self):
12954  * cdef __Pyx_memviewslice src, dst
12955  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12956  *
12957  * slice_copy(self, &src)
12958  */
12959  __Pyx_TraceLine(647,0,__PYX_ERR(2, 647, __pyx_L1_error))
12960  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12961 
12962  /* "View.MemoryView":649
12963  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12964  *
12965  * slice_copy(self, &src) # <<<<<<<<<<<<<<
12966  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12967  * self.view.itemsize,
12968  */
12969  __Pyx_TraceLine(649,0,__PYX_ERR(2, 649, __pyx_L1_error))
12970  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12971 
12972  /* "View.MemoryView":650
12973  *
12974  * slice_copy(self, &src)
12975  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12976  * self.view.itemsize,
12977  * flags|PyBUF_F_CONTIGUOUS,
12978  */
12979  __Pyx_TraceLine(650,0,__PYX_ERR(2, 650, __pyx_L1_error))
12980  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 650, __pyx_L1_error)
12981  __pyx_v_dst = __pyx_t_1;
12982 
12983  /* "View.MemoryView":655
12984  * self.dtype_is_object)
12985  *
12986  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12987  *
12988  *
12989  */
12990  __Pyx_TraceLine(655,0,__PYX_ERR(2, 655, __pyx_L1_error))
12991  __Pyx_XDECREF(__pyx_r);
12992  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 655, __pyx_L1_error)
12993  __Pyx_GOTREF(__pyx_t_2);
12994  __pyx_r = __pyx_t_2;
12995  __pyx_t_2 = 0;
12996  goto __pyx_L0;
12997 
12998  /* "View.MemoryView":645
12999  * return memoryview_copy_from_slice(self, &mslice)
13000  *
13001  * def copy_fortran(self): # <<<<<<<<<<<<<<
13002  * cdef __Pyx_memviewslice src, dst
13003  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13004  */
13005 
13006  /* function exit code */
13007  __pyx_L1_error:;
13008  __Pyx_XDECREF(__pyx_t_2);
13009  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13010  __pyx_r = NULL;
13011  __pyx_L0:;
13012  __Pyx_XGIVEREF(__pyx_r);
13013  __Pyx_TraceReturn(__pyx_r, 0);
13014  __Pyx_RefNannyFinishContext();
13015  return __pyx_r;
13016 }
13017 
13018 /* "(tree fragment)":1
13019  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13020  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13021  * def __setstate_cython__(self, __pyx_state):
13022  */
13023 
13024 /* Python wrapper */
13025 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13026 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
13027 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13028  PyObject *__pyx_r = 0;
13029  __Pyx_RefNannyDeclarations
13030  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13031  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13032 
13033  /* function exit code */
13034  __Pyx_RefNannyFinishContext();
13035  return __pyx_r;
13036 }
13037 
13038 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
13039  PyObject *__pyx_r = NULL;
13040  __Pyx_TraceDeclarations
13041  __Pyx_RefNannyDeclarations
13042  PyObject *__pyx_t_1 = NULL;
13043  int __pyx_lineno = 0;
13044  const char *__pyx_filename = NULL;
13045  int __pyx_clineno = 0;
13046  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13047  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
13048 
13049  /* "(tree fragment)":2
13050  * def __reduce_cython__(self):
13051  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13052  * def __setstate_cython__(self, __pyx_state):
13053  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13054  */
13055  __Pyx_TraceLine(2,0,__PYX_ERR(2, 2, __pyx_L1_error))
13056  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
13057  __Pyx_GOTREF(__pyx_t_1);
13058  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13059  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13060  __PYX_ERR(2, 2, __pyx_L1_error)
13061 
13062  /* "(tree fragment)":1
13063  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13064  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13065  * def __setstate_cython__(self, __pyx_state):
13066  */
13067 
13068  /* function exit code */
13069  __pyx_L1_error:;
13070  __Pyx_XDECREF(__pyx_t_1);
13071  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13072  __pyx_r = NULL;
13073  __Pyx_XGIVEREF(__pyx_r);
13074  __Pyx_TraceReturn(__pyx_r, 0);
13075  __Pyx_RefNannyFinishContext();
13076  return __pyx_r;
13077 }
13078 
13079 /* "(tree fragment)":3
13080  * def __reduce_cython__(self):
13081  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13082  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13083  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13084  */
13085 
13086 /* Python wrapper */
13087 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13088 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
13089 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13090  PyObject *__pyx_r = 0;
13091  __Pyx_RefNannyDeclarations
13092  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13093  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13094 
13095  /* function exit code */
13096  __Pyx_RefNannyFinishContext();
13097  return __pyx_r;
13098 }
13099 
13100 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13101  PyObject *__pyx_r = NULL;
13102  __Pyx_TraceDeclarations
13103  __Pyx_RefNannyDeclarations
13104  PyObject *__pyx_t_1 = NULL;
13105  int __pyx_lineno = 0;
13106  const char *__pyx_filename = NULL;
13107  int __pyx_clineno = 0;
13108  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13109  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 3, 0, __PYX_ERR(2, 3, __pyx_L1_error));
13110 
13111  /* "(tree fragment)":4
13112  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13113  * def __setstate_cython__(self, __pyx_state):
13114  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13115  */
13116  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
13117  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
13118  __Pyx_GOTREF(__pyx_t_1);
13119  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13120  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13121  __PYX_ERR(2, 4, __pyx_L1_error)
13122 
13123  /* "(tree fragment)":3
13124  * def __reduce_cython__(self):
13125  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13126  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13127  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13128  */
13129 
13130  /* function exit code */
13131  __pyx_L1_error:;
13132  __Pyx_XDECREF(__pyx_t_1);
13133  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13134  __pyx_r = NULL;
13135  __Pyx_XGIVEREF(__pyx_r);
13136  __Pyx_TraceReturn(__pyx_r, 0);
13137  __Pyx_RefNannyFinishContext();
13138  return __pyx_r;
13139 }
13140 
13141 /* "View.MemoryView":659
13142  *
13143  * @cname('__pyx_memoryview_new')
13144  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13145  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13146  * result.typeinfo = typeinfo
13147  */
13148 
13149 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13150  struct __pyx_memoryview_obj *__pyx_v_result = 0;
13151  PyObject *__pyx_r = NULL;
13152  __Pyx_TraceDeclarations
13153  __Pyx_RefNannyDeclarations
13154  PyObject *__pyx_t_1 = NULL;
13155  PyObject *__pyx_t_2 = NULL;
13156  PyObject *__pyx_t_3 = NULL;
13157  int __pyx_lineno = 0;
13158  const char *__pyx_filename = NULL;
13159  int __pyx_clineno = 0;
13160  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
13161  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[2], 659, 0, __PYX_ERR(2, 659, __pyx_L1_error));
13162 
13163  /* "View.MemoryView":660
13164  * @cname('__pyx_memoryview_new')
13165  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13166  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
13167  * result.typeinfo = typeinfo
13168  * return result
13169  */
13170  __Pyx_TraceLine(660,0,__PYX_ERR(2, 660, __pyx_L1_error))
13171  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error)
13172  __Pyx_GOTREF(__pyx_t_1);
13173  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error)
13174  __Pyx_GOTREF(__pyx_t_2);
13175  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 660, __pyx_L1_error)
13176  __Pyx_GOTREF(__pyx_t_3);
13177  __Pyx_INCREF(__pyx_v_o);
13178  __Pyx_GIVEREF(__pyx_v_o);
13179  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13180  __Pyx_GIVEREF(__pyx_t_1);
13181  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13182  __Pyx_GIVEREF(__pyx_t_2);
13183  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13184  __pyx_t_1 = 0;
13185  __pyx_t_2 = 0;
13186  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error)
13187  __Pyx_GOTREF(__pyx_t_2);
13188  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13189  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13190  __pyx_t_2 = 0;
13191 
13192  /* "View.MemoryView":661
13193  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13194  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13195  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
13196  * return result
13197  *
13198  */
13199  __Pyx_TraceLine(661,0,__PYX_ERR(2, 661, __pyx_L1_error))
13200  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13201 
13202  /* "View.MemoryView":662
13203  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13204  * result.typeinfo = typeinfo
13205  * return result # <<<<<<<<<<<<<<
13206  *
13207  * @cname('__pyx_memoryview_check')
13208  */
13209  __Pyx_TraceLine(662,0,__PYX_ERR(2, 662, __pyx_L1_error))
13210  __Pyx_XDECREF(__pyx_r);
13211  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13212  __pyx_r = ((PyObject *)__pyx_v_result);
13213  goto __pyx_L0;
13214 
13215  /* "View.MemoryView":659
13216  *
13217  * @cname('__pyx_memoryview_new')
13218  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13219  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13220  * result.typeinfo = typeinfo
13221  */
13222 
13223  /* function exit code */
13224  __pyx_L1_error:;
13225  __Pyx_XDECREF(__pyx_t_1);
13226  __Pyx_XDECREF(__pyx_t_2);
13227  __Pyx_XDECREF(__pyx_t_3);
13228  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13229  __pyx_r = 0;
13230  __pyx_L0:;
13231  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13232  __Pyx_XGIVEREF(__pyx_r);
13233  __Pyx_TraceReturn(__pyx_r, 0);
13234  __Pyx_RefNannyFinishContext();
13235  return __pyx_r;
13236 }
13237 
13238 /* "View.MemoryView":665
13239  *
13240  * @cname('__pyx_memoryview_check')
13241  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13242  * return isinstance(o, memoryview)
13243  *
13244  */
13245 
13246 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13247  int __pyx_r;
13248  __Pyx_TraceDeclarations
13249  __Pyx_RefNannyDeclarations
13250  int __pyx_t_1;
13251  int __pyx_lineno = 0;
13252  const char *__pyx_filename = NULL;
13253  int __pyx_clineno = 0;
13254  __Pyx_RefNannySetupContext("memoryview_check", 0);
13255  __Pyx_TraceCall("memoryview_check", __pyx_f[2], 665, 0, __PYX_ERR(2, 665, __pyx_L1_error));
13256 
13257  /* "View.MemoryView":666
13258  * @cname('__pyx_memoryview_check')
13259  * cdef inline bint memoryview_check(object o):
13260  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
13261  *
13262  * cdef tuple _unellipsify(object index, int ndim):
13263  */
13264  __Pyx_TraceLine(666,0,__PYX_ERR(2, 666, __pyx_L1_error))
13265  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13266  __pyx_r = __pyx_t_1;
13267  goto __pyx_L0;
13268 
13269  /* "View.MemoryView":665
13270  *
13271  * @cname('__pyx_memoryview_check')
13272  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13273  * return isinstance(o, memoryview)
13274  *
13275  */
13276 
13277  /* function exit code */
13278  __pyx_L1_error:;
13279  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13280  __pyx_r = 0;
13281  __pyx_L0:;
13282  __Pyx_TraceReturn(Py_None, 0);
13283  __Pyx_RefNannyFinishContext();
13284  return __pyx_r;
13285 }
13286 
13287 /* "View.MemoryView":668
13288  * return isinstance(o, memoryview)
13289  *
13290  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13291  * """
13292  * Replace all ellipses with full slices and fill incomplete indices with
13293  */
13294 
13295 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13296  PyObject *__pyx_v_tup = NULL;
13297  PyObject *__pyx_v_result = NULL;
13298  int __pyx_v_have_slices;
13299  int __pyx_v_seen_ellipsis;
13300  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13301  PyObject *__pyx_v_item = NULL;
13302  Py_ssize_t __pyx_v_nslices;
13303  PyObject *__pyx_r = NULL;
13304  __Pyx_TraceDeclarations
13305  __Pyx_RefNannyDeclarations
13306  int __pyx_t_1;
13307  int __pyx_t_2;
13308  PyObject *__pyx_t_3 = NULL;
13309  PyObject *__pyx_t_4 = NULL;
13310  Py_ssize_t __pyx_t_5;
13311  PyObject *(*__pyx_t_6)(PyObject *);
13312  PyObject *__pyx_t_7 = NULL;
13313  Py_ssize_t __pyx_t_8;
13314  int __pyx_t_9;
13315  int __pyx_t_10;
13316  PyObject *__pyx_t_11 = NULL;
13317  int __pyx_lineno = 0;
13318  const char *__pyx_filename = NULL;
13319  int __pyx_clineno = 0;
13320  __Pyx_RefNannySetupContext("_unellipsify", 0);
13321  __Pyx_TraceCall("_unellipsify", __pyx_f[2], 668, 0, __PYX_ERR(2, 668, __pyx_L1_error));
13322 
13323  /* "View.MemoryView":673
13324  * full slices.
13325  * """
13326  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13327  * tup = (index,)
13328  * else:
13329  */
13330  __Pyx_TraceLine(673,0,__PYX_ERR(2, 673, __pyx_L1_error))
13331  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13332  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13333  if (__pyx_t_2) {
13334 
13335  /* "View.MemoryView":674
13336  * """
13337  * if not isinstance(index, tuple):
13338  * tup = (index,) # <<<<<<<<<<<<<<
13339  * else:
13340  * tup = index
13341  */
13342  __Pyx_TraceLine(674,0,__PYX_ERR(2, 674, __pyx_L1_error))
13343  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 674, __pyx_L1_error)
13344  __Pyx_GOTREF(__pyx_t_3);
13345  __Pyx_INCREF(__pyx_v_index);
13346  __Pyx_GIVEREF(__pyx_v_index);
13347  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13348  __pyx_v_tup = __pyx_t_3;
13349  __pyx_t_3 = 0;
13350 
13351  /* "View.MemoryView":673
13352  * full slices.
13353  * """
13354  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13355  * tup = (index,)
13356  * else:
13357  */
13358  goto __pyx_L3;
13359  }
13360 
13361  /* "View.MemoryView":676
13362  * tup = (index,)
13363  * else:
13364  * tup = index # <<<<<<<<<<<<<<
13365  *
13366  * result = []
13367  */
13368  __Pyx_TraceLine(676,0,__PYX_ERR(2, 676, __pyx_L1_error))
13369  /*else*/ {
13370  __Pyx_INCREF(__pyx_v_index);
13371  __pyx_v_tup = __pyx_v_index;
13372  }
13373  __pyx_L3:;
13374 
13375  /* "View.MemoryView":678
13376  * tup = index
13377  *
13378  * result = [] # <<<<<<<<<<<<<<
13379  * have_slices = False
13380  * seen_ellipsis = False
13381  */
13382  __Pyx_TraceLine(678,0,__PYX_ERR(2, 678, __pyx_L1_error))
13383  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 678, __pyx_L1_error)
13384  __Pyx_GOTREF(__pyx_t_3);
13385  __pyx_v_result = ((PyObject*)__pyx_t_3);
13386  __pyx_t_3 = 0;
13387 
13388  /* "View.MemoryView":679
13389  *
13390  * result = []
13391  * have_slices = False # <<<<<<<<<<<<<<
13392  * seen_ellipsis = False
13393  * for idx, item in enumerate(tup):
13394  */
13395  __Pyx_TraceLine(679,0,__PYX_ERR(2, 679, __pyx_L1_error))
13396  __pyx_v_have_slices = 0;
13397 
13398  /* "View.MemoryView":680
13399  * result = []
13400  * have_slices = False
13401  * seen_ellipsis = False # <<<<<<<<<<<<<<
13402  * for idx, item in enumerate(tup):
13403  * if item is Ellipsis:
13404  */
13405  __Pyx_TraceLine(680,0,__PYX_ERR(2, 680, __pyx_L1_error))
13406  __pyx_v_seen_ellipsis = 0;
13407 
13408  /* "View.MemoryView":681
13409  * have_slices = False
13410  * seen_ellipsis = False
13411  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13412  * if item is Ellipsis:
13413  * if not seen_ellipsis:
13414  */
13415  __Pyx_TraceLine(681,0,__PYX_ERR(2, 681, __pyx_L1_error))
13416  __Pyx_INCREF(__pyx_int_0);
13417  __pyx_t_3 = __pyx_int_0;
13418  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
13419  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
13420  __pyx_t_6 = NULL;
13421  } else {
13422  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 681, __pyx_L1_error)
13423  __Pyx_GOTREF(__pyx_t_4);
13424  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 681, __pyx_L1_error)
13425  }
13426  for (;;) {
13427  if (likely(!__pyx_t_6)) {
13428  if (likely(PyList_CheckExact(__pyx_t_4))) {
13429  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
13430  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13431  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error)
13432  #else
13433  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
13434  __Pyx_GOTREF(__pyx_t_7);
13435  #endif
13436  } else {
13437  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
13438  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13439  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error)
13440  #else
13441  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
13442  __Pyx_GOTREF(__pyx_t_7);
13443  #endif
13444  }
13445  } else {
13446  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
13447  if (unlikely(!__pyx_t_7)) {
13448  PyObject* exc_type = PyErr_Occurred();
13449  if (exc_type) {
13450  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13451  else __PYX_ERR(2, 681, __pyx_L1_error)
13452  }
13453  break;
13454  }
13455  __Pyx_GOTREF(__pyx_t_7);
13456  }
13457  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
13458  __pyx_t_7 = 0;
13459  __Pyx_INCREF(__pyx_t_3);
13460  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
13461  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
13462  __Pyx_GOTREF(__pyx_t_7);
13463  __Pyx_DECREF(__pyx_t_3);
13464  __pyx_t_3 = __pyx_t_7;
13465  __pyx_t_7 = 0;
13466 
13467  /* "View.MemoryView":682
13468  * seen_ellipsis = False
13469  * for idx, item in enumerate(tup):
13470  * if item is Ellipsis: # <<<<<<<<<<<<<<
13471  * if not seen_ellipsis:
13472  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13473  */
13474  __Pyx_TraceLine(682,0,__PYX_ERR(2, 682, __pyx_L1_error))
13475  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13476  __pyx_t_1 = (__pyx_t_2 != 0);
13477  if (__pyx_t_1) {
13478 
13479  /* "View.MemoryView":683
13480  * for idx, item in enumerate(tup):
13481  * if item is Ellipsis:
13482  * if not seen_ellipsis: # <<<<<<<<<<<<<<
13483  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13484  * seen_ellipsis = True
13485  */
13486  __Pyx_TraceLine(683,0,__PYX_ERR(2, 683, __pyx_L1_error))
13487  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
13488  if (__pyx_t_1) {
13489 
13490  /* "View.MemoryView":684
13491  * if item is Ellipsis:
13492  * if not seen_ellipsis:
13493  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
13494  * seen_ellipsis = True
13495  * else:
13496  */
13497  __Pyx_TraceLine(684,0,__PYX_ERR(2, 684, __pyx_L1_error))
13498  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 684, __pyx_L1_error)
13499  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error)
13500  __Pyx_GOTREF(__pyx_t_7);
13501  { Py_ssize_t __pyx_temp;
13502  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
13503  __Pyx_INCREF(__pyx_slice__17);
13504  __Pyx_GIVEREF(__pyx_slice__17);
13505  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__17);
13506  }
13507  }
13508  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 684, __pyx_L1_error)
13509  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13510 
13511  /* "View.MemoryView":685
13512  * if not seen_ellipsis:
13513  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13514  * seen_ellipsis = True # <<<<<<<<<<<<<<
13515  * else:
13516  * result.append(slice(None))
13517  */
13518  __Pyx_TraceLine(685,0,__PYX_ERR(2, 685, __pyx_L1_error))
13519  __pyx_v_seen_ellipsis = 1;
13520 
13521  /* "View.MemoryView":683
13522  * for idx, item in enumerate(tup):
13523  * if item is Ellipsis:
13524  * if not seen_ellipsis: # <<<<<<<<<<<<<<
13525  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13526  * seen_ellipsis = True
13527  */
13528  goto __pyx_L7;
13529  }
13530 
13531  /* "View.MemoryView":687
13532  * seen_ellipsis = True
13533  * else:
13534  * result.append(slice(None)) # <<<<<<<<<<<<<<
13535  * have_slices = True
13536  * else:
13537  */
13538  __Pyx_TraceLine(687,0,__PYX_ERR(2, 687, __pyx_L1_error))
13539  /*else*/ {
13540  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 687, __pyx_L1_error)
13541  }
13542  __pyx_L7:;
13543 
13544  /* "View.MemoryView":688
13545  * else:
13546  * result.append(slice(None))
13547  * have_slices = True # <<<<<<<<<<<<<<
13548  * else:
13549  * if not isinstance(item, slice) and not PyIndex_Check(item):
13550  */
13551  __Pyx_TraceLine(688,0,__PYX_ERR(2, 688, __pyx_L1_error))
13552  __pyx_v_have_slices = 1;
13553 
13554  /* "View.MemoryView":682
13555  * seen_ellipsis = False
13556  * for idx, item in enumerate(tup):
13557  * if item is Ellipsis: # <<<<<<<<<<<<<<
13558  * if not seen_ellipsis:
13559  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13560  */
13561  goto __pyx_L6;
13562  }
13563 
13564  /* "View.MemoryView":690
13565  * have_slices = True
13566  * else:
13567  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
13568  * raise TypeError("Cannot index with type '%s'" % type(item))
13569  *
13570  */
13571  __Pyx_TraceLine(690,0,__PYX_ERR(2, 690, __pyx_L1_error))
13572  /*else*/ {
13573  __pyx_t_2 = PySlice_Check(__pyx_v_item);
13574  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
13575  if (__pyx_t_10) {
13576  } else {
13577  __pyx_t_1 = __pyx_t_10;
13578  goto __pyx_L9_bool_binop_done;
13579  }
13580  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
13581  __pyx_t_1 = __pyx_t_10;
13582  __pyx_L9_bool_binop_done:;
13583  if (unlikely(__pyx_t_1)) {
13584 
13585  /* "View.MemoryView":691
13586  * else:
13587  * if not isinstance(item, slice) and not PyIndex_Check(item):
13588  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
13589  *
13590  * have_slices = have_slices or isinstance(item, slice)
13591  */
13592  __Pyx_TraceLine(691,0,__PYX_ERR(2, 691, __pyx_L1_error))
13593  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error)
13594  __Pyx_GOTREF(__pyx_t_7);
13595  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 691, __pyx_L1_error)
13596  __Pyx_GOTREF(__pyx_t_11);
13597  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13598  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
13599  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13600  __PYX_ERR(2, 691, __pyx_L1_error)
13601 
13602  /* "View.MemoryView":690
13603  * have_slices = True
13604  * else:
13605  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
13606  * raise TypeError("Cannot index with type '%s'" % type(item))
13607  *
13608  */
13609  }
13610 
13611  /* "View.MemoryView":693
13612  * raise TypeError("Cannot index with type '%s'" % type(item))
13613  *
13614  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
13615  * result.append(item)
13616  *
13617  */
13618  __Pyx_TraceLine(693,0,__PYX_ERR(2, 693, __pyx_L1_error))
13619  __pyx_t_10 = (__pyx_v_have_slices != 0);
13620  if (!__pyx_t_10) {
13621  } else {
13622  __pyx_t_1 = __pyx_t_10;
13623  goto __pyx_L11_bool_binop_done;
13624  }
13625  __pyx_t_10 = PySlice_Check(__pyx_v_item);
13626  __pyx_t_2 = (__pyx_t_10 != 0);
13627  __pyx_t_1 = __pyx_t_2;
13628  __pyx_L11_bool_binop_done:;
13629  __pyx_v_have_slices = __pyx_t_1;
13630 
13631  /* "View.MemoryView":694
13632  *
13633  * have_slices = have_slices or isinstance(item, slice)
13634  * result.append(item) # <<<<<<<<<<<<<<
13635  *
13636  * nslices = ndim - len(result)
13637  */
13638  __Pyx_TraceLine(694,0,__PYX_ERR(2, 694, __pyx_L1_error))
13639  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
13640  }
13641  __pyx_L6:;
13642 
13643  /* "View.MemoryView":681
13644  * have_slices = False
13645  * seen_ellipsis = False
13646  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13647  * if item is Ellipsis:
13648  * if not seen_ellipsis:
13649  */
13650  __Pyx_TraceLine(681,0,__PYX_ERR(2, 681, __pyx_L1_error))
13651  }
13652  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13653  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13654 
13655  /* "View.MemoryView":696
13656  * result.append(item)
13657  *
13658  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
13659  * if nslices:
13660  * result.extend([slice(None)] * nslices)
13661  */
13662  __Pyx_TraceLine(696,0,__PYX_ERR(2, 696, __pyx_L1_error))
13663  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
13664  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
13665 
13666  /* "View.MemoryView":697
13667  *
13668  * nslices = ndim - len(result)
13669  * if nslices: # <<<<<<<<<<<<<<
13670  * result.extend([slice(None)] * nslices)
13671  *
13672  */
13673  __Pyx_TraceLine(697,0,__PYX_ERR(2, 697, __pyx_L1_error))
13674  __pyx_t_1 = (__pyx_v_nslices != 0);
13675  if (__pyx_t_1) {
13676 
13677  /* "View.MemoryView":698
13678  * nslices = ndim - len(result)
13679  * if nslices:
13680  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
13681  *
13682  * return have_slices or nslices, tuple(result)
13683  */
13684  __Pyx_TraceLine(698,0,__PYX_ERR(2, 698, __pyx_L1_error))
13685  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 698, __pyx_L1_error)
13686  __Pyx_GOTREF(__pyx_t_3);
13687  { Py_ssize_t __pyx_temp;
13688  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
13689  __Pyx_INCREF(__pyx_slice__17);
13690  __Pyx_GIVEREF(__pyx_slice__17);
13691  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17);
13692  }
13693  }
13694  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 698, __pyx_L1_error)
13695  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13696 
13697  /* "View.MemoryView":697
13698  *
13699  * nslices = ndim - len(result)
13700  * if nslices: # <<<<<<<<<<<<<<
13701  * result.extend([slice(None)] * nslices)
13702  *
13703  */
13704  }
13705 
13706  /* "View.MemoryView":700
13707  * result.extend([slice(None)] * nslices)
13708  *
13709  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
13710  *
13711  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13712  */
13713  __Pyx_TraceLine(700,0,__PYX_ERR(2, 700, __pyx_L1_error))
13714  __Pyx_XDECREF(__pyx_r);
13715  if (!__pyx_v_have_slices) {
13716  } else {
13717  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
13718  __Pyx_GOTREF(__pyx_t_4);
13719  __pyx_t_3 = __pyx_t_4;
13720  __pyx_t_4 = 0;
13721  goto __pyx_L14_bool_binop_done;
13722  }
13723  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
13724  __Pyx_GOTREF(__pyx_t_4);
13725  __pyx_t_3 = __pyx_t_4;
13726  __pyx_t_4 = 0;
13727  __pyx_L14_bool_binop_done:;
13728  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
13729  __Pyx_GOTREF(__pyx_t_4);
13730  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 700, __pyx_L1_error)
13731  __Pyx_GOTREF(__pyx_t_11);
13732  __Pyx_GIVEREF(__pyx_t_3);
13733  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
13734  __Pyx_GIVEREF(__pyx_t_4);
13735  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
13736  __pyx_t_3 = 0;
13737  __pyx_t_4 = 0;
13738  __pyx_r = ((PyObject*)__pyx_t_11);
13739  __pyx_t_11 = 0;
13740  goto __pyx_L0;
13741 
13742  /* "View.MemoryView":668
13743  * return isinstance(o, memoryview)
13744  *
13745  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13746  * """
13747  * Replace all ellipses with full slices and fill incomplete indices with
13748  */
13749 
13750  /* function exit code */
13751  __pyx_L1_error:;
13752  __Pyx_XDECREF(__pyx_t_3);
13753  __Pyx_XDECREF(__pyx_t_4);
13754  __Pyx_XDECREF(__pyx_t_7);
13755  __Pyx_XDECREF(__pyx_t_11);
13756  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13757  __pyx_r = 0;
13758  __pyx_L0:;
13759  __Pyx_XDECREF(__pyx_v_tup);
13760  __Pyx_XDECREF(__pyx_v_result);
13761  __Pyx_XDECREF(__pyx_v_idx);
13762  __Pyx_XDECREF(__pyx_v_item);
13763  __Pyx_XGIVEREF(__pyx_r);
13764  __Pyx_TraceReturn(__pyx_r, 0);
13765  __Pyx_RefNannyFinishContext();
13766  return __pyx_r;
13767 }
13768 
13769 /* "View.MemoryView":702
13770  * return have_slices or nslices, tuple(result)
13771  *
13772  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
13773  * for suboffset in suboffsets[:ndim]:
13774  * if suboffset >= 0:
13775  */
13776 
13777 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13778  Py_ssize_t __pyx_v_suboffset;
13779  PyObject *__pyx_r = NULL;
13780  __Pyx_TraceDeclarations
13781  __Pyx_RefNannyDeclarations
13782  Py_ssize_t *__pyx_t_1;
13783  Py_ssize_t *__pyx_t_2;
13784  Py_ssize_t *__pyx_t_3;
13785  int __pyx_t_4;
13786  PyObject *__pyx_t_5 = NULL;
13787  int __pyx_lineno = 0;
13788  const char *__pyx_filename = NULL;
13789  int __pyx_clineno = 0;
13790  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
13791  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[2], 702, 0, __PYX_ERR(2, 702, __pyx_L1_error));
13792 
13793  /* "View.MemoryView":703
13794  *
13795  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13796  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13797  * if suboffset >= 0:
13798  * raise ValueError("Indirect dimensions not supported")
13799  */
13800  __Pyx_TraceLine(703,0,__PYX_ERR(2, 703, __pyx_L1_error))
13801  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13802  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13803  __pyx_t_1 = __pyx_t_3;
13804  __pyx_v_suboffset = (__pyx_t_1[0]);
13805 
13806  /* "View.MemoryView":704
13807  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13808  * for suboffset in suboffsets[:ndim]:
13809  * if suboffset >= 0: # <<<<<<<<<<<<<<
13810  * raise ValueError("Indirect dimensions not supported")
13811  *
13812  */
13813  __Pyx_TraceLine(704,0,__PYX_ERR(2, 704, __pyx_L1_error))
13814  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
13815  if (unlikely(__pyx_t_4)) {
13816 
13817  /* "View.MemoryView":705
13818  * for suboffset in suboffsets[:ndim]:
13819  * if suboffset >= 0:
13820  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13821  *
13822  *
13823  */
13824  __Pyx_TraceLine(705,0,__PYX_ERR(2, 705, __pyx_L1_error))
13825  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 705, __pyx_L1_error)
13826  __Pyx_GOTREF(__pyx_t_5);
13827  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
13828  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13829  __PYX_ERR(2, 705, __pyx_L1_error)
13830 
13831  /* "View.MemoryView":704
13832  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13833  * for suboffset in suboffsets[:ndim]:
13834  * if suboffset >= 0: # <<<<<<<<<<<<<<
13835  * raise ValueError("Indirect dimensions not supported")
13836  *
13837  */
13838  }
13839  }
13840 
13841  /* "View.MemoryView":702
13842  * return have_slices or nslices, tuple(result)
13843  *
13844  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
13845  * for suboffset in suboffsets[:ndim]:
13846  * if suboffset >= 0:
13847  */
13848 
13849  /* function exit code */
13850  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13851  goto __pyx_L0;
13852  __pyx_L1_error:;
13853  __Pyx_XDECREF(__pyx_t_5);
13854  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13855  __pyx_r = 0;
13856  __pyx_L0:;
13857  __Pyx_XGIVEREF(__pyx_r);
13858  __Pyx_TraceReturn(__pyx_r, 0);
13859  __Pyx_RefNannyFinishContext();
13860  return __pyx_r;
13861 }
13862 
13863 /* "View.MemoryView":712
13864  *
13865  * @cname('__pyx_memview_slice')
13866  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13867  * cdef int new_ndim = 0, suboffset_dim = -1, dim
13868  * cdef bint negative_step
13869  */
13870 
13871 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13872  int __pyx_v_new_ndim;
13873  int __pyx_v_suboffset_dim;
13874  int __pyx_v_dim;
13875  __Pyx_memviewslice __pyx_v_src;
13876  __Pyx_memviewslice __pyx_v_dst;
13877  __Pyx_memviewslice *__pyx_v_p_src;
13878  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13879  __Pyx_memviewslice *__pyx_v_p_dst;
13880  int *__pyx_v_p_suboffset_dim;
13881  Py_ssize_t __pyx_v_start;
13882  Py_ssize_t __pyx_v_stop;
13883  Py_ssize_t __pyx_v_step;
13884  int __pyx_v_have_start;
13885  int __pyx_v_have_stop;
13886  int __pyx_v_have_step;
13887  PyObject *__pyx_v_index = NULL;
13888  struct __pyx_memoryview_obj *__pyx_r = NULL;
13889  __Pyx_TraceDeclarations
13890  __Pyx_RefNannyDeclarations
13891  int __pyx_t_1;
13892  int __pyx_t_2;
13893  PyObject *__pyx_t_3 = NULL;
13894  struct __pyx_memoryview_obj *__pyx_t_4;
13895  char *__pyx_t_5;
13896  int __pyx_t_6;
13897  Py_ssize_t __pyx_t_7;
13898  PyObject *(*__pyx_t_8)(PyObject *);
13899  PyObject *__pyx_t_9 = NULL;
13900  Py_ssize_t __pyx_t_10;
13901  int __pyx_t_11;
13902  Py_ssize_t __pyx_t_12;
13903  int __pyx_lineno = 0;
13904  const char *__pyx_filename = NULL;
13905  int __pyx_clineno = 0;
13906  __Pyx_RefNannySetupContext("memview_slice", 0);
13907  __Pyx_TraceCall("memview_slice", __pyx_f[2], 712, 0, __PYX_ERR(2, 712, __pyx_L1_error));
13908 
13909  /* "View.MemoryView":713
13910  * @cname('__pyx_memview_slice')
13911  * cdef memoryview memview_slice(memoryview memview, object indices):
13912  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13913  * cdef bint negative_step
13914  * cdef __Pyx_memviewslice src, dst
13915  */
13916  __Pyx_TraceLine(713,0,__PYX_ERR(2, 713, __pyx_L1_error))
13917  __pyx_v_new_ndim = 0;
13918  __pyx_v_suboffset_dim = -1;
13919 
13920  /* "View.MemoryView":720
13921  *
13922  *
13923  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13924  *
13925  * cdef _memoryviewslice memviewsliceobj
13926  */
13927  __Pyx_TraceLine(720,0,__PYX_ERR(2, 720, __pyx_L1_error))
13928  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13929 
13930  /* "View.MemoryView":724
13931  * cdef _memoryviewslice memviewsliceobj
13932  *
13933  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13934  *
13935  * if isinstance(memview, _memoryviewslice):
13936  */
13937  __Pyx_TraceLine(724,0,__PYX_ERR(2, 724, __pyx_L1_error))
13938  #ifndef CYTHON_WITHOUT_ASSERTIONS
13939  if (unlikely(__pyx_assertions_enabled())) {
13940  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
13941  PyErr_SetNone(PyExc_AssertionError);
13942  __PYX_ERR(2, 724, __pyx_L1_error)
13943  }
13944  }
13945  #endif
13946 
13947  /* "View.MemoryView":726
13948  * assert memview.view.ndim > 0
13949  *
13950  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13951  * memviewsliceobj = memview
13952  * p_src = &memviewsliceobj.from_slice
13953  */
13954  __Pyx_TraceLine(726,0,__PYX_ERR(2, 726, __pyx_L1_error))
13955  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13956  __pyx_t_2 = (__pyx_t_1 != 0);
13957  if (__pyx_t_2) {
13958 
13959  /* "View.MemoryView":727
13960  *
13961  * if isinstance(memview, _memoryviewslice):
13962  * memviewsliceobj = memview # <<<<<<<<<<<<<<
13963  * p_src = &memviewsliceobj.from_slice
13964  * else:
13965  */
13966  __Pyx_TraceLine(727,0,__PYX_ERR(2, 727, __pyx_L1_error))
13967  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 727, __pyx_L1_error)
13968  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
13969  __Pyx_INCREF(__pyx_t_3);
13970  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
13971  __pyx_t_3 = 0;
13972 
13973  /* "View.MemoryView":728
13974  * if isinstance(memview, _memoryviewslice):
13975  * memviewsliceobj = memview
13976  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13977  * else:
13978  * slice_copy(memview, &src)
13979  */
13980  __Pyx_TraceLine(728,0,__PYX_ERR(2, 728, __pyx_L1_error))
13981  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13982 
13983  /* "View.MemoryView":726
13984  * assert memview.view.ndim > 0
13985  *
13986  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13987  * memviewsliceobj = memview
13988  * p_src = &memviewsliceobj.from_slice
13989  */
13990  goto __pyx_L3;
13991  }
13992 
13993  /* "View.MemoryView":730
13994  * p_src = &memviewsliceobj.from_slice
13995  * else:
13996  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13997  * p_src = &src
13998  *
13999  */
14000  __Pyx_TraceLine(730,0,__PYX_ERR(2, 730, __pyx_L1_error))
14001  /*else*/ {
14002  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14003 
14004  /* "View.MemoryView":731
14005  * else:
14006  * slice_copy(memview, &src)
14007  * p_src = &src # <<<<<<<<<<<<<<
14008  *
14009  *
14010  */
14011  __Pyx_TraceLine(731,0,__PYX_ERR(2, 731, __pyx_L1_error))
14012  __pyx_v_p_src = (&__pyx_v_src);
14013  }
14014  __pyx_L3:;
14015 
14016  /* "View.MemoryView":737
14017  *
14018  *
14019  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14020  * dst.data = p_src.data
14021  *
14022  */
14023  __Pyx_TraceLine(737,0,__PYX_ERR(2, 737, __pyx_L1_error))
14024  __pyx_t_4 = __pyx_v_p_src->memview;
14025  __pyx_v_dst.memview = __pyx_t_4;
14026 
14027  /* "View.MemoryView":738
14028  *
14029  * dst.memview = p_src.memview
14030  * dst.data = p_src.data # <<<<<<<<<<<<<<
14031  *
14032  *
14033  */
14034  __Pyx_TraceLine(738,0,__PYX_ERR(2, 738, __pyx_L1_error))
14035  __pyx_t_5 = __pyx_v_p_src->data;
14036  __pyx_v_dst.data = __pyx_t_5;
14037 
14038  /* "View.MemoryView":743
14039  *
14040  *
14041  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14042  * cdef int *p_suboffset_dim = &suboffset_dim
14043  * cdef Py_ssize_t start, stop, step
14044  */
14045  __Pyx_TraceLine(743,0,__PYX_ERR(2, 743, __pyx_L1_error))
14046  __pyx_v_p_dst = (&__pyx_v_dst);
14047 
14048  /* "View.MemoryView":744
14049  *
14050  * cdef __Pyx_memviewslice *p_dst = &dst
14051  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14052  * cdef Py_ssize_t start, stop, step
14053  * cdef bint have_start, have_stop, have_step
14054  */
14055  __Pyx_TraceLine(744,0,__PYX_ERR(2, 744, __pyx_L1_error))
14056  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14057 
14058  /* "View.MemoryView":748
14059  * cdef bint have_start, have_stop, have_step
14060  *
14061  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14062  * if PyIndex_Check(index):
14063  * slice_memviewslice(
14064  */
14065  __Pyx_TraceLine(748,0,__PYX_ERR(2, 748, __pyx_L1_error))
14066  __pyx_t_6 = 0;
14067  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14068  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14069  __pyx_t_8 = NULL;
14070  } else {
14071  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 748, __pyx_L1_error)
14072  __Pyx_GOTREF(__pyx_t_3);
14073  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 748, __pyx_L1_error)
14074  }
14075  for (;;) {
14076  if (likely(!__pyx_t_8)) {
14077  if (likely(PyList_CheckExact(__pyx_t_3))) {
14078  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
14079  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14080  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error)
14081  #else
14082  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error)
14083  __Pyx_GOTREF(__pyx_t_9);
14084  #endif
14085  } else {
14086  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
14087  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14088  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error)
14089  #else
14090  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error)
14091  __Pyx_GOTREF(__pyx_t_9);
14092  #endif
14093  }
14094  } else {
14095  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14096  if (unlikely(!__pyx_t_9)) {
14097  PyObject* exc_type = PyErr_Occurred();
14098  if (exc_type) {
14099  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14100  else __PYX_ERR(2, 748, __pyx_L1_error)
14101  }
14102  break;
14103  }
14104  __Pyx_GOTREF(__pyx_t_9);
14105  }
14106  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14107  __pyx_t_9 = 0;
14108  __pyx_v_dim = __pyx_t_6;
14109  __pyx_t_6 = (__pyx_t_6 + 1);
14110 
14111  /* "View.MemoryView":749
14112  *
14113  * for dim, index in enumerate(indices):
14114  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14115  * slice_memviewslice(
14116  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14117  */
14118  __Pyx_TraceLine(749,0,__PYX_ERR(2, 749, __pyx_L1_error))
14119  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14120  if (__pyx_t_2) {
14121 
14122  /* "View.MemoryView":753
14123  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14124  * dim, new_ndim, p_suboffset_dim,
14125  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
14126  * 0, 0, 0, # have_{start,stop,step}
14127  * False)
14128  */
14129  __Pyx_TraceLine(753,0,__PYX_ERR(2, 753, __pyx_L1_error))
14130  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 753, __pyx_L1_error)
14131 
14132  /* "View.MemoryView":750
14133  * for dim, index in enumerate(indices):
14134  * if PyIndex_Check(index):
14135  * slice_memviewslice( # <<<<<<<<<<<<<<
14136  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14137  * dim, new_ndim, p_suboffset_dim,
14138  */
14139  __Pyx_TraceLine(750,0,__PYX_ERR(2, 750, __pyx_L1_error))
14140  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 750, __pyx_L1_error)
14141 
14142  /* "View.MemoryView":749
14143  *
14144  * for dim, index in enumerate(indices):
14145  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14146  * slice_memviewslice(
14147  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14148  */
14149  goto __pyx_L6;
14150  }
14151 
14152  /* "View.MemoryView":756
14153  * 0, 0, 0, # have_{start,stop,step}
14154  * False)
14155  * elif index is None: # <<<<<<<<<<<<<<
14156  * p_dst.shape[new_ndim] = 1
14157  * p_dst.strides[new_ndim] = 0
14158  */
14159  __Pyx_TraceLine(756,0,__PYX_ERR(2, 756, __pyx_L1_error))
14160  __pyx_t_2 = (__pyx_v_index == Py_None);
14161  __pyx_t_1 = (__pyx_t_2 != 0);
14162  if (__pyx_t_1) {
14163 
14164  /* "View.MemoryView":757
14165  * False)
14166  * elif index is None:
14167  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
14168  * p_dst.strides[new_ndim] = 0
14169  * p_dst.suboffsets[new_ndim] = -1
14170  */
14171  __Pyx_TraceLine(757,0,__PYX_ERR(2, 757, __pyx_L1_error))
14172  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14173 
14174  /* "View.MemoryView":758
14175  * elif index is None:
14176  * p_dst.shape[new_ndim] = 1
14177  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
14178  * p_dst.suboffsets[new_ndim] = -1
14179  * new_ndim += 1
14180  */
14181  __Pyx_TraceLine(758,0,__PYX_ERR(2, 758, __pyx_L1_error))
14182  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14183 
14184  /* "View.MemoryView":759
14185  * p_dst.shape[new_ndim] = 1
14186  * p_dst.strides[new_ndim] = 0
14187  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
14188  * new_ndim += 1
14189  * else:
14190  */
14191  __Pyx_TraceLine(759,0,__PYX_ERR(2, 759, __pyx_L1_error))
14192  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14193 
14194  /* "View.MemoryView":760
14195  * p_dst.strides[new_ndim] = 0
14196  * p_dst.suboffsets[new_ndim] = -1
14197  * new_ndim += 1 # <<<<<<<<<<<<<<
14198  * else:
14199  * start = index.start or 0
14200  */
14201  __Pyx_TraceLine(760,0,__PYX_ERR(2, 760, __pyx_L1_error))
14202  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14203 
14204  /* "View.MemoryView":756
14205  * 0, 0, 0, # have_{start,stop,step}
14206  * False)
14207  * elif index is None: # <<<<<<<<<<<<<<
14208  * p_dst.shape[new_ndim] = 1
14209  * p_dst.strides[new_ndim] = 0
14210  */
14211  goto __pyx_L6;
14212  }
14213 
14214  /* "View.MemoryView":762
14215  * new_ndim += 1
14216  * else:
14217  * start = index.start or 0 # <<<<<<<<<<<<<<
14218  * stop = index.stop or 0
14219  * step = index.step or 0
14220  */
14221  __Pyx_TraceLine(762,0,__PYX_ERR(2, 762, __pyx_L1_error))
14222  /*else*/ {
14223  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
14224  __Pyx_GOTREF(__pyx_t_9);
14225  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
14226  if (!__pyx_t_1) {
14227  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14228  } else {
14229  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
14230  __pyx_t_10 = __pyx_t_12;
14231  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14232  goto __pyx_L7_bool_binop_done;
14233  }
14234  __pyx_t_10 = 0;
14235  __pyx_L7_bool_binop_done:;
14236  __pyx_v_start = __pyx_t_10;
14237 
14238  /* "View.MemoryView":763
14239  * else:
14240  * start = index.start or 0
14241  * stop = index.stop or 0 # <<<<<<<<<<<<<<
14242  * step = index.step or 0
14243  *
14244  */
14245  __Pyx_TraceLine(763,0,__PYX_ERR(2, 763, __pyx_L1_error))
14246  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 763, __pyx_L1_error)
14247  __Pyx_GOTREF(__pyx_t_9);
14248  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 763, __pyx_L1_error)
14249  if (!__pyx_t_1) {
14250  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14251  } else {
14252  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 763, __pyx_L1_error)
14253  __pyx_t_10 = __pyx_t_12;
14254  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14255  goto __pyx_L9_bool_binop_done;
14256  }
14257  __pyx_t_10 = 0;
14258  __pyx_L9_bool_binop_done:;
14259  __pyx_v_stop = __pyx_t_10;
14260 
14261  /* "View.MemoryView":764
14262  * start = index.start or 0
14263  * stop = index.stop or 0
14264  * step = index.step or 0 # <<<<<<<<<<<<<<
14265  *
14266  * have_start = index.start is not None
14267  */
14268  __Pyx_TraceLine(764,0,__PYX_ERR(2, 764, __pyx_L1_error))
14269  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
14270  __Pyx_GOTREF(__pyx_t_9);
14271  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 764, __pyx_L1_error)
14272  if (!__pyx_t_1) {
14273  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14274  } else {
14275  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 764, __pyx_L1_error)
14276  __pyx_t_10 = __pyx_t_12;
14277  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14278  goto __pyx_L11_bool_binop_done;
14279  }
14280  __pyx_t_10 = 0;
14281  __pyx_L11_bool_binop_done:;
14282  __pyx_v_step = __pyx_t_10;
14283 
14284  /* "View.MemoryView":766
14285  * step = index.step or 0
14286  *
14287  * have_start = index.start is not None # <<<<<<<<<<<<<<
14288  * have_stop = index.stop is not None
14289  * have_step = index.step is not None
14290  */
14291  __Pyx_TraceLine(766,0,__PYX_ERR(2, 766, __pyx_L1_error))
14292  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
14293  __Pyx_GOTREF(__pyx_t_9);
14294  __pyx_t_1 = (__pyx_t_9 != Py_None);
14295  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14296  __pyx_v_have_start = __pyx_t_1;
14297 
14298  /* "View.MemoryView":767
14299  *
14300  * have_start = index.start is not None
14301  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14302  * have_step = index.step is not None
14303  *
14304  */
14305  __Pyx_TraceLine(767,0,__PYX_ERR(2, 767, __pyx_L1_error))
14306  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 767, __pyx_L1_error)
14307  __Pyx_GOTREF(__pyx_t_9);
14308  __pyx_t_1 = (__pyx_t_9 != Py_None);
14309  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14310  __pyx_v_have_stop = __pyx_t_1;
14311 
14312  /* "View.MemoryView":768
14313  * have_start = index.start is not None
14314  * have_stop = index.stop is not None
14315  * have_step = index.step is not None # <<<<<<<<<<<<<<
14316  *
14317  * slice_memviewslice(
14318  */
14319  __Pyx_TraceLine(768,0,__PYX_ERR(2, 768, __pyx_L1_error))
14320  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 768, __pyx_L1_error)
14321  __Pyx_GOTREF(__pyx_t_9);
14322  __pyx_t_1 = (__pyx_t_9 != Py_None);
14323  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14324  __pyx_v_have_step = __pyx_t_1;
14325 
14326  /* "View.MemoryView":770
14327  * have_step = index.step is not None
14328  *
14329  * slice_memviewslice( # <<<<<<<<<<<<<<
14330  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14331  * dim, new_ndim, p_suboffset_dim,
14332  */
14333  __Pyx_TraceLine(770,0,__PYX_ERR(2, 770, __pyx_L1_error))
14334  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 770, __pyx_L1_error)
14335 
14336  /* "View.MemoryView":776
14337  * have_start, have_stop, have_step,
14338  * True)
14339  * new_ndim += 1 # <<<<<<<<<<<<<<
14340  *
14341  * if isinstance(memview, _memoryviewslice):
14342  */
14343  __Pyx_TraceLine(776,0,__PYX_ERR(2, 776, __pyx_L1_error))
14344  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14345  }
14346  __pyx_L6:;
14347 
14348  /* "View.MemoryView":748
14349  * cdef bint have_start, have_stop, have_step
14350  *
14351  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14352  * if PyIndex_Check(index):
14353  * slice_memviewslice(
14354  */
14355  __Pyx_TraceLine(748,0,__PYX_ERR(2, 748, __pyx_L1_error))
14356  }
14357  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14358 
14359  /* "View.MemoryView":778
14360  * new_ndim += 1
14361  *
14362  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14363  * return memoryview_fromslice(dst, new_ndim,
14364  * memviewsliceobj.to_object_func,
14365  */
14366  __Pyx_TraceLine(778,0,__PYX_ERR(2, 778, __pyx_L1_error))
14367  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14368  __pyx_t_2 = (__pyx_t_1 != 0);
14369  if (__pyx_t_2) {
14370 
14371  /* "View.MemoryView":779
14372  *
14373  * if isinstance(memview, _memoryviewslice):
14374  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14375  * memviewsliceobj.to_object_func,
14376  * memviewsliceobj.to_dtype_func,
14377  */
14378  __Pyx_TraceLine(779,0,__PYX_ERR(2, 779, __pyx_L1_error))
14379  __Pyx_XDECREF(((PyObject *)__pyx_r));
14380 
14381  /* "View.MemoryView":780
14382  * if isinstance(memview, _memoryviewslice):
14383  * return memoryview_fromslice(dst, new_ndim,
14384  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14385  * memviewsliceobj.to_dtype_func,
14386  * memview.dtype_is_object)
14387  */
14388  __Pyx_TraceLine(780,0,__PYX_ERR(2, 780, __pyx_L1_error))
14389  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 780, __pyx_L1_error) }
14390 
14391  /* "View.MemoryView":781
14392  * return memoryview_fromslice(dst, new_ndim,
14393  * memviewsliceobj.to_object_func,
14394  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14395  * memview.dtype_is_object)
14396  * else:
14397  */
14398  __Pyx_TraceLine(781,0,__PYX_ERR(2, 781, __pyx_L1_error))
14399  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 781, __pyx_L1_error) }
14400 
14401  /* "View.MemoryView":779
14402  *
14403  * if isinstance(memview, _memoryviewslice):
14404  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14405  * memviewsliceobj.to_object_func,
14406  * memviewsliceobj.to_dtype_func,
14407  */
14408  __Pyx_TraceLine(779,0,__PYX_ERR(2, 779, __pyx_L1_error))
14409  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 779, __pyx_L1_error)
14410  __Pyx_GOTREF(__pyx_t_3);
14411  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 779, __pyx_L1_error)
14412  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14413  __pyx_t_3 = 0;
14414  goto __pyx_L0;
14415 
14416  /* "View.MemoryView":778
14417  * new_ndim += 1
14418  *
14419  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14420  * return memoryview_fromslice(dst, new_ndim,
14421  * memviewsliceobj.to_object_func,
14422  */
14423  }
14424 
14425  /* "View.MemoryView":784
14426  * memview.dtype_is_object)
14427  * else:
14428  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14429  * memview.dtype_is_object)
14430  *
14431  */
14432  __Pyx_TraceLine(784,0,__PYX_ERR(2, 784, __pyx_L1_error))
14433  /*else*/ {
14434  __Pyx_XDECREF(((PyObject *)__pyx_r));
14435 
14436  /* "View.MemoryView":785
14437  * else:
14438  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14439  * memview.dtype_is_object) # <<<<<<<<<<<<<<
14440  *
14441  *
14442  */
14443  __Pyx_TraceLine(785,0,__PYX_ERR(2, 785, __pyx_L1_error))
14444  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 784, __pyx_L1_error)
14445  __Pyx_GOTREF(__pyx_t_3);
14446 
14447  /* "View.MemoryView":784
14448  * memview.dtype_is_object)
14449  * else:
14450  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14451  * memview.dtype_is_object)
14452  *
14453  */
14454  __Pyx_TraceLine(784,0,__PYX_ERR(2, 784, __pyx_L1_error))
14455  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 784, __pyx_L1_error)
14456  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14457  __pyx_t_3 = 0;
14458  goto __pyx_L0;
14459  }
14460 
14461  /* "View.MemoryView":712
14462  *
14463  * @cname('__pyx_memview_slice')
14464  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14465  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14466  * cdef bint negative_step
14467  */
14468 
14469  /* function exit code */
14470  __pyx_L1_error:;
14471  __Pyx_XDECREF(__pyx_t_3);
14472  __Pyx_XDECREF(__pyx_t_9);
14473  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14474  __pyx_r = 0;
14475  __pyx_L0:;
14476  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14477  __Pyx_XDECREF(__pyx_v_index);
14478  __Pyx_XGIVEREF((PyObject *)__pyx_r);
14479  __Pyx_TraceReturn(__pyx_r, 0);
14480  __Pyx_RefNannyFinishContext();
14481  return __pyx_r;
14482 }
14483 
14484 /* "View.MemoryView":809
14485  *
14486  * @cname('__pyx_memoryview_slice_memviewslice')
14487  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14488  * __Pyx_memviewslice *dst,
14489  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14490  */
14491 
14492 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
14493  Py_ssize_t __pyx_v_new_shape;
14494  int __pyx_v_negative_step;
14495  int __pyx_r;
14496  __Pyx_TraceDeclarations
14497  int __pyx_t_1;
14498  int __pyx_t_2;
14499  int __pyx_t_3;
14500  int __pyx_lineno = 0;
14501  const char *__pyx_filename = NULL;
14502  int __pyx_clineno = 0;
14503  __Pyx_TraceCall("slice_memviewslice", __pyx_f[2], 809, 1, __PYX_ERR(2, 809, __pyx_L1_error));
14504 
14505  /* "View.MemoryView":829
14506  * cdef bint negative_step
14507  *
14508  * if not is_slice: # <<<<<<<<<<<<<<
14509  *
14510  * if start < 0:
14511  */
14512  __Pyx_TraceLine(829,1,__PYX_ERR(2, 829, __pyx_L1_error))
14513  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
14514  if (__pyx_t_1) {
14515 
14516  /* "View.MemoryView":831
14517  * if not is_slice:
14518  *
14519  * if start < 0: # <<<<<<<<<<<<<<
14520  * start += shape
14521  * if not 0 <= start < shape:
14522  */
14523  __Pyx_TraceLine(831,1,__PYX_ERR(2, 831, __pyx_L1_error))
14524  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
14525  if (__pyx_t_1) {
14526 
14527  /* "View.MemoryView":832
14528  *
14529  * if start < 0:
14530  * start += shape # <<<<<<<<<<<<<<
14531  * if not 0 <= start < shape:
14532  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14533  */
14534  __Pyx_TraceLine(832,1,__PYX_ERR(2, 832, __pyx_L1_error))
14535  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14536 
14537  /* "View.MemoryView":831
14538  * if not is_slice:
14539  *
14540  * if start < 0: # <<<<<<<<<<<<<<
14541  * start += shape
14542  * if not 0 <= start < shape:
14543  */
14544  }
14545 
14546  /* "View.MemoryView":833
14547  * if start < 0:
14548  * start += shape
14549  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14550  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14551  * else:
14552  */
14553  __Pyx_TraceLine(833,1,__PYX_ERR(2, 833, __pyx_L1_error))
14554  __pyx_t_1 = (0 <= __pyx_v_start);
14555  if (__pyx_t_1) {
14556  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14557  }
14558  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14559  if (__pyx_t_2) {
14560 
14561  /* "View.MemoryView":834
14562  * start += shape
14563  * if not 0 <= start < shape:
14564  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
14565  * else:
14566  *
14567  */
14568  __Pyx_TraceLine(834,1,__PYX_ERR(2, 834, __pyx_L1_error))
14569  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error)
14570 
14571  /* "View.MemoryView":833
14572  * if start < 0:
14573  * start += shape
14574  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14575  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14576  * else:
14577  */
14578  }
14579 
14580  /* "View.MemoryView":829
14581  * cdef bint negative_step
14582  *
14583  * if not is_slice: # <<<<<<<<<<<<<<
14584  *
14585  * if start < 0:
14586  */
14587  goto __pyx_L3;
14588  }
14589 
14590  /* "View.MemoryView":837
14591  * else:
14592  *
14593  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
14594  *
14595  * if have_step and step == 0:
14596  */
14597  __Pyx_TraceLine(837,1,__PYX_ERR(2, 837, __pyx_L1_error))
14598  /*else*/ {
14599  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
14600  if (__pyx_t_1) {
14601  } else {
14602  __pyx_t_2 = __pyx_t_1;
14603  goto __pyx_L6_bool_binop_done;
14604  }
14605  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
14606  __pyx_t_2 = __pyx_t_1;
14607  __pyx_L6_bool_binop_done:;
14608  __pyx_v_negative_step = __pyx_t_2;
14609 
14610  /* "View.MemoryView":839
14611  * negative_step = have_step != 0 and step < 0
14612  *
14613  * if have_step and step == 0: # <<<<<<<<<<<<<<
14614  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14615  *
14616  */
14617  __Pyx_TraceLine(839,1,__PYX_ERR(2, 839, __pyx_L1_error))
14618  __pyx_t_1 = (__pyx_v_have_step != 0);
14619  if (__pyx_t_1) {
14620  } else {
14621  __pyx_t_2 = __pyx_t_1;
14622  goto __pyx_L9_bool_binop_done;
14623  }
14624  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
14625  __pyx_t_2 = __pyx_t_1;
14626  __pyx_L9_bool_binop_done:;
14627  if (__pyx_t_2) {
14628 
14629  /* "View.MemoryView":840
14630  *
14631  * if have_step and step == 0:
14632  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
14633  *
14634  *
14635  */
14636  __Pyx_TraceLine(840,1,__PYX_ERR(2, 840, __pyx_L1_error))
14637  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 840, __pyx_L1_error)
14638 
14639  /* "View.MemoryView":839
14640  * negative_step = have_step != 0 and step < 0
14641  *
14642  * if have_step and step == 0: # <<<<<<<<<<<<<<
14643  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14644  *
14645  */
14646  }
14647 
14648  /* "View.MemoryView":843
14649  *
14650  *
14651  * if have_start: # <<<<<<<<<<<<<<
14652  * if start < 0:
14653  * start += shape
14654  */
14655  __Pyx_TraceLine(843,1,__PYX_ERR(2, 843, __pyx_L1_error))
14656  __pyx_t_2 = (__pyx_v_have_start != 0);
14657  if (__pyx_t_2) {
14658 
14659  /* "View.MemoryView":844
14660  *
14661  * if have_start:
14662  * if start < 0: # <<<<<<<<<<<<<<
14663  * start += shape
14664  * if start < 0:
14665  */
14666  __Pyx_TraceLine(844,1,__PYX_ERR(2, 844, __pyx_L1_error))
14667  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14668  if (__pyx_t_2) {
14669 
14670  /* "View.MemoryView":845
14671  * if have_start:
14672  * if start < 0:
14673  * start += shape # <<<<<<<<<<<<<<
14674  * if start < 0:
14675  * start = 0
14676  */
14677  __Pyx_TraceLine(845,1,__PYX_ERR(2, 845, __pyx_L1_error))
14678  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14679 
14680  /* "View.MemoryView":846
14681  * if start < 0:
14682  * start += shape
14683  * if start < 0: # <<<<<<<<<<<<<<
14684  * start = 0
14685  * elif start >= shape:
14686  */
14687  __Pyx_TraceLine(846,1,__PYX_ERR(2, 846, __pyx_L1_error))
14688  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14689  if (__pyx_t_2) {
14690 
14691  /* "View.MemoryView":847
14692  * start += shape
14693  * if start < 0:
14694  * start = 0 # <<<<<<<<<<<<<<
14695  * elif start >= shape:
14696  * if negative_step:
14697  */
14698  __Pyx_TraceLine(847,1,__PYX_ERR(2, 847, __pyx_L1_error))
14699  __pyx_v_start = 0;
14700 
14701  /* "View.MemoryView":846
14702  * if start < 0:
14703  * start += shape
14704  * if start < 0: # <<<<<<<<<<<<<<
14705  * start = 0
14706  * elif start >= shape:
14707  */
14708  }
14709 
14710  /* "View.MemoryView":844
14711  *
14712  * if have_start:
14713  * if start < 0: # <<<<<<<<<<<<<<
14714  * start += shape
14715  * if start < 0:
14716  */
14717  goto __pyx_L12;
14718  }
14719 
14720  /* "View.MemoryView":848
14721  * if start < 0:
14722  * start = 0
14723  * elif start >= shape: # <<<<<<<<<<<<<<
14724  * if negative_step:
14725  * start = shape - 1
14726  */
14727  __Pyx_TraceLine(848,1,__PYX_ERR(2, 848, __pyx_L1_error))
14728  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
14729  if (__pyx_t_2) {
14730 
14731  /* "View.MemoryView":849
14732  * start = 0
14733  * elif start >= shape:
14734  * if negative_step: # <<<<<<<<<<<<<<
14735  * start = shape - 1
14736  * else:
14737  */
14738  __Pyx_TraceLine(849,1,__PYX_ERR(2, 849, __pyx_L1_error))
14739  __pyx_t_2 = (__pyx_v_negative_step != 0);
14740  if (__pyx_t_2) {
14741 
14742  /* "View.MemoryView":850
14743  * elif start >= shape:
14744  * if negative_step:
14745  * start = shape - 1 # <<<<<<<<<<<<<<
14746  * else:
14747  * start = shape
14748  */
14749  __Pyx_TraceLine(850,1,__PYX_ERR(2, 850, __pyx_L1_error))
14750  __pyx_v_start = (__pyx_v_shape - 1);
14751 
14752  /* "View.MemoryView":849
14753  * start = 0
14754  * elif start >= shape:
14755  * if negative_step: # <<<<<<<<<<<<<<
14756  * start = shape - 1
14757  * else:
14758  */
14759  goto __pyx_L14;
14760  }
14761 
14762  /* "View.MemoryView":852
14763  * start = shape - 1
14764  * else:
14765  * start = shape # <<<<<<<<<<<<<<
14766  * else:
14767  * if negative_step:
14768  */
14769  __Pyx_TraceLine(852,1,__PYX_ERR(2, 852, __pyx_L1_error))
14770  /*else*/ {
14771  __pyx_v_start = __pyx_v_shape;
14772  }
14773  __pyx_L14:;
14774 
14775  /* "View.MemoryView":848
14776  * if start < 0:
14777  * start = 0
14778  * elif start >= shape: # <<<<<<<<<<<<<<
14779  * if negative_step:
14780  * start = shape - 1
14781  */
14782  }
14783  __pyx_L12:;
14784 
14785  /* "View.MemoryView":843
14786  *
14787  *
14788  * if have_start: # <<<<<<<<<<<<<<
14789  * if start < 0:
14790  * start += shape
14791  */
14792  goto __pyx_L11;
14793  }
14794 
14795  /* "View.MemoryView":854
14796  * start = shape
14797  * else:
14798  * if negative_step: # <<<<<<<<<<<<<<
14799  * start = shape - 1
14800  * else:
14801  */
14802  __Pyx_TraceLine(854,1,__PYX_ERR(2, 854, __pyx_L1_error))
14803  /*else*/ {
14804  __pyx_t_2 = (__pyx_v_negative_step != 0);
14805  if (__pyx_t_2) {
14806 
14807  /* "View.MemoryView":855
14808  * else:
14809  * if negative_step:
14810  * start = shape - 1 # <<<<<<<<<<<<<<
14811  * else:
14812  * start = 0
14813  */
14814  __Pyx_TraceLine(855,1,__PYX_ERR(2, 855, __pyx_L1_error))
14815  __pyx_v_start = (__pyx_v_shape - 1);
14816 
14817  /* "View.MemoryView":854
14818  * start = shape
14819  * else:
14820  * if negative_step: # <<<<<<<<<<<<<<
14821  * start = shape - 1
14822  * else:
14823  */
14824  goto __pyx_L15;
14825  }
14826 
14827  /* "View.MemoryView":857
14828  * start = shape - 1
14829  * else:
14830  * start = 0 # <<<<<<<<<<<<<<
14831  *
14832  * if have_stop:
14833  */
14834  __Pyx_TraceLine(857,1,__PYX_ERR(2, 857, __pyx_L1_error))
14835  /*else*/ {
14836  __pyx_v_start = 0;
14837  }
14838  __pyx_L15:;
14839  }
14840  __pyx_L11:;
14841 
14842  /* "View.MemoryView":859
14843  * start = 0
14844  *
14845  * if have_stop: # <<<<<<<<<<<<<<
14846  * if stop < 0:
14847  * stop += shape
14848  */
14849  __Pyx_TraceLine(859,1,__PYX_ERR(2, 859, __pyx_L1_error))
14850  __pyx_t_2 = (__pyx_v_have_stop != 0);
14851  if (__pyx_t_2) {
14852 
14853  /* "View.MemoryView":860
14854  *
14855  * if have_stop:
14856  * if stop < 0: # <<<<<<<<<<<<<<
14857  * stop += shape
14858  * if stop < 0:
14859  */
14860  __Pyx_TraceLine(860,1,__PYX_ERR(2, 860, __pyx_L1_error))
14861  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14862  if (__pyx_t_2) {
14863 
14864  /* "View.MemoryView":861
14865  * if have_stop:
14866  * if stop < 0:
14867  * stop += shape # <<<<<<<<<<<<<<
14868  * if stop < 0:
14869  * stop = 0
14870  */
14871  __Pyx_TraceLine(861,1,__PYX_ERR(2, 861, __pyx_L1_error))
14872  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14873 
14874  /* "View.MemoryView":862
14875  * if stop < 0:
14876  * stop += shape
14877  * if stop < 0: # <<<<<<<<<<<<<<
14878  * stop = 0
14879  * elif stop > shape:
14880  */
14881  __Pyx_TraceLine(862,1,__PYX_ERR(2, 862, __pyx_L1_error))
14882  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14883  if (__pyx_t_2) {
14884 
14885  /* "View.MemoryView":863
14886  * stop += shape
14887  * if stop < 0:
14888  * stop = 0 # <<<<<<<<<<<<<<
14889  * elif stop > shape:
14890  * stop = shape
14891  */
14892  __Pyx_TraceLine(863,1,__PYX_ERR(2, 863, __pyx_L1_error))
14893  __pyx_v_stop = 0;
14894 
14895  /* "View.MemoryView":862
14896  * if stop < 0:
14897  * stop += shape
14898  * if stop < 0: # <<<<<<<<<<<<<<
14899  * stop = 0
14900  * elif stop > shape:
14901  */
14902  }
14903 
14904  /* "View.MemoryView":860
14905  *
14906  * if have_stop:
14907  * if stop < 0: # <<<<<<<<<<<<<<
14908  * stop += shape
14909  * if stop < 0:
14910  */
14911  goto __pyx_L17;
14912  }
14913 
14914  /* "View.MemoryView":864
14915  * if stop < 0:
14916  * stop = 0
14917  * elif stop > shape: # <<<<<<<<<<<<<<
14918  * stop = shape
14919  * else:
14920  */
14921  __Pyx_TraceLine(864,1,__PYX_ERR(2, 864, __pyx_L1_error))
14922  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
14923  if (__pyx_t_2) {
14924 
14925  /* "View.MemoryView":865
14926  * stop = 0
14927  * elif stop > shape:
14928  * stop = shape # <<<<<<<<<<<<<<
14929  * else:
14930  * if negative_step:
14931  */
14932  __Pyx_TraceLine(865,1,__PYX_ERR(2, 865, __pyx_L1_error))
14933  __pyx_v_stop = __pyx_v_shape;
14934 
14935  /* "View.MemoryView":864
14936  * if stop < 0:
14937  * stop = 0
14938  * elif stop > shape: # <<<<<<<<<<<<<<
14939  * stop = shape
14940  * else:
14941  */
14942  }
14943  __pyx_L17:;
14944 
14945  /* "View.MemoryView":859
14946  * start = 0
14947  *
14948  * if have_stop: # <<<<<<<<<<<<<<
14949  * if stop < 0:
14950  * stop += shape
14951  */
14952  goto __pyx_L16;
14953  }
14954 
14955  /* "View.MemoryView":867
14956  * stop = shape
14957  * else:
14958  * if negative_step: # <<<<<<<<<<<<<<
14959  * stop = -1
14960  * else:
14961  */
14962  __Pyx_TraceLine(867,1,__PYX_ERR(2, 867, __pyx_L1_error))
14963  /*else*/ {
14964  __pyx_t_2 = (__pyx_v_negative_step != 0);
14965  if (__pyx_t_2) {
14966 
14967  /* "View.MemoryView":868
14968  * else:
14969  * if negative_step:
14970  * stop = -1 # <<<<<<<<<<<<<<
14971  * else:
14972  * stop = shape
14973  */
14974  __Pyx_TraceLine(868,1,__PYX_ERR(2, 868, __pyx_L1_error))
14975  __pyx_v_stop = -1L;
14976 
14977  /* "View.MemoryView":867
14978  * stop = shape
14979  * else:
14980  * if negative_step: # <<<<<<<<<<<<<<
14981  * stop = -1
14982  * else:
14983  */
14984  goto __pyx_L19;
14985  }
14986 
14987  /* "View.MemoryView":870
14988  * stop = -1
14989  * else:
14990  * stop = shape # <<<<<<<<<<<<<<
14991  *
14992  * if not have_step:
14993  */
14994  __Pyx_TraceLine(870,1,__PYX_ERR(2, 870, __pyx_L1_error))
14995  /*else*/ {
14996  __pyx_v_stop = __pyx_v_shape;
14997  }
14998  __pyx_L19:;
14999  }
15000  __pyx_L16:;
15001 
15002  /* "View.MemoryView":872
15003  * stop = shape
15004  *
15005  * if not have_step: # <<<<<<<<<<<<<<
15006  * step = 1
15007  *
15008  */
15009  __Pyx_TraceLine(872,1,__PYX_ERR(2, 872, __pyx_L1_error))
15010  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15011  if (__pyx_t_2) {
15012 
15013  /* "View.MemoryView":873
15014  *
15015  * if not have_step:
15016  * step = 1 # <<<<<<<<<<<<<<
15017  *
15018  *
15019  */
15020  __Pyx_TraceLine(873,1,__PYX_ERR(2, 873, __pyx_L1_error))
15021  __pyx_v_step = 1;
15022 
15023  /* "View.MemoryView":872
15024  * stop = shape
15025  *
15026  * if not have_step: # <<<<<<<<<<<<<<
15027  * step = 1
15028  *
15029  */
15030  }
15031 
15032  /* "View.MemoryView":877
15033  *
15034  * with cython.cdivision(True):
15035  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
15036  *
15037  * if (stop - start) - step * new_shape:
15038  */
15039  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15040 
15041  /* "View.MemoryView":879
15042  * new_shape = (stop - start) // step
15043  *
15044  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15045  * new_shape += 1
15046  *
15047  */
15048  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15049  if (__pyx_t_2) {
15050 
15051  /* "View.MemoryView":880
15052  *
15053  * if (stop - start) - step * new_shape:
15054  * new_shape += 1 # <<<<<<<<<<<<<<
15055  *
15056  * if new_shape < 0:
15057  */
15058  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15059 
15060  /* "View.MemoryView":879
15061  * new_shape = (stop - start) // step
15062  *
15063  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15064  * new_shape += 1
15065  *
15066  */
15067  }
15068 
15069  /* "View.MemoryView":882
15070  * new_shape += 1
15071  *
15072  * if new_shape < 0: # <<<<<<<<<<<<<<
15073  * new_shape = 0
15074  *
15075  */
15076  __Pyx_TraceLine(882,1,__PYX_ERR(2, 882, __pyx_L1_error))
15077  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15078  if (__pyx_t_2) {
15079 
15080  /* "View.MemoryView":883
15081  *
15082  * if new_shape < 0:
15083  * new_shape = 0 # <<<<<<<<<<<<<<
15084  *
15085  *
15086  */
15087  __Pyx_TraceLine(883,1,__PYX_ERR(2, 883, __pyx_L1_error))
15088  __pyx_v_new_shape = 0;
15089 
15090  /* "View.MemoryView":882
15091  * new_shape += 1
15092  *
15093  * if new_shape < 0: # <<<<<<<<<<<<<<
15094  * new_shape = 0
15095  *
15096  */
15097  }
15098 
15099  /* "View.MemoryView":886
15100  *
15101  *
15102  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
15103  * dst.shape[new_ndim] = new_shape
15104  * dst.suboffsets[new_ndim] = suboffset
15105  */
15106  __Pyx_TraceLine(886,1,__PYX_ERR(2, 886, __pyx_L1_error))
15107  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15108 
15109  /* "View.MemoryView":887
15110  *
15111  * dst.strides[new_ndim] = stride * step
15112  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
15113  * dst.suboffsets[new_ndim] = suboffset
15114  *
15115  */
15116  __Pyx_TraceLine(887,1,__PYX_ERR(2, 887, __pyx_L1_error))
15117  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15118 
15119  /* "View.MemoryView":888
15120  * dst.strides[new_ndim] = stride * step
15121  * dst.shape[new_ndim] = new_shape
15122  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
15123  *
15124  *
15125  */
15126  __Pyx_TraceLine(888,1,__PYX_ERR(2, 888, __pyx_L1_error))
15127  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15128  }
15129  __pyx_L3:;
15130 
15131  /* "View.MemoryView":891
15132  *
15133  *
15134  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15135  * dst.data += start * stride
15136  * else:
15137  */
15138  __Pyx_TraceLine(891,1,__PYX_ERR(2, 891, __pyx_L1_error))
15139  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15140  if (__pyx_t_2) {
15141 
15142  /* "View.MemoryView":892
15143  *
15144  * if suboffset_dim[0] < 0:
15145  * dst.data += start * stride # <<<<<<<<<<<<<<
15146  * else:
15147  * dst.suboffsets[suboffset_dim[0]] += start * stride
15148  */
15149  __Pyx_TraceLine(892,1,__PYX_ERR(2, 892, __pyx_L1_error))
15150  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15151 
15152  /* "View.MemoryView":891
15153  *
15154  *
15155  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15156  * dst.data += start * stride
15157  * else:
15158  */
15159  goto __pyx_L23;
15160  }
15161 
15162  /* "View.MemoryView":894
15163  * dst.data += start * stride
15164  * else:
15165  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
15166  *
15167  * if suboffset >= 0:
15168  */
15169  __Pyx_TraceLine(894,1,__PYX_ERR(2, 894, __pyx_L1_error))
15170  /*else*/ {
15171  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15172  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15173  }
15174  __pyx_L23:;
15175 
15176  /* "View.MemoryView":896
15177  * dst.suboffsets[suboffset_dim[0]] += start * stride
15178  *
15179  * if suboffset >= 0: # <<<<<<<<<<<<<<
15180  * if not is_slice:
15181  * if new_ndim == 0:
15182  */
15183  __Pyx_TraceLine(896,1,__PYX_ERR(2, 896, __pyx_L1_error))
15184  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15185  if (__pyx_t_2) {
15186 
15187  /* "View.MemoryView":897
15188  *
15189  * if suboffset >= 0:
15190  * if not is_slice: # <<<<<<<<<<<<<<
15191  * if new_ndim == 0:
15192  * dst.data = (<char **> dst.data)[0] + suboffset
15193  */
15194  __Pyx_TraceLine(897,1,__PYX_ERR(2, 897, __pyx_L1_error))
15195  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15196  if (__pyx_t_2) {
15197 
15198  /* "View.MemoryView":898
15199  * if suboffset >= 0:
15200  * if not is_slice:
15201  * if new_ndim == 0: # <<<<<<<<<<<<<<
15202  * dst.data = (<char **> dst.data)[0] + suboffset
15203  * else:
15204  */
15205  __Pyx_TraceLine(898,1,__PYX_ERR(2, 898, __pyx_L1_error))
15206  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15207  if (__pyx_t_2) {
15208 
15209  /* "View.MemoryView":899
15210  * if not is_slice:
15211  * if new_ndim == 0:
15212  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
15213  * else:
15214  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15215  */
15216  __Pyx_TraceLine(899,1,__PYX_ERR(2, 899, __pyx_L1_error))
15217  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15218 
15219  /* "View.MemoryView":898
15220  * if suboffset >= 0:
15221  * if not is_slice:
15222  * if new_ndim == 0: # <<<<<<<<<<<<<<
15223  * dst.data = (<char **> dst.data)[0] + suboffset
15224  * else:
15225  */
15226  goto __pyx_L26;
15227  }
15228 
15229  /* "View.MemoryView":901
15230  * dst.data = (<char **> dst.data)[0] + suboffset
15231  * else:
15232  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
15233  * "must be indexed and not sliced", dim)
15234  * else:
15235  */
15236  __Pyx_TraceLine(901,1,__PYX_ERR(2, 901, __pyx_L1_error))
15237  /*else*/ {
15238 
15239  /* "View.MemoryView":902
15240  * else:
15241  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15242  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
15243  * else:
15244  * suboffset_dim[0] = new_ndim
15245  */
15246  __Pyx_TraceLine(902,1,__PYX_ERR(2, 902, __pyx_L1_error))
15247  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 901, __pyx_L1_error)
15248  }
15249  __pyx_L26:;
15250 
15251  /* "View.MemoryView":897
15252  *
15253  * if suboffset >= 0:
15254  * if not is_slice: # <<<<<<<<<<<<<<
15255  * if new_ndim == 0:
15256  * dst.data = (<char **> dst.data)[0] + suboffset
15257  */
15258  goto __pyx_L25;
15259  }
15260 
15261  /* "View.MemoryView":904
15262  * "must be indexed and not sliced", dim)
15263  * else:
15264  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
15265  *
15266  * return 0
15267  */
15268  __Pyx_TraceLine(904,1,__PYX_ERR(2, 904, __pyx_L1_error))
15269  /*else*/ {
15270  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15271  }
15272  __pyx_L25:;
15273 
15274  /* "View.MemoryView":896
15275  * dst.suboffsets[suboffset_dim[0]] += start * stride
15276  *
15277  * if suboffset >= 0: # <<<<<<<<<<<<<<
15278  * if not is_slice:
15279  * if new_ndim == 0:
15280  */
15281  }
15282 
15283  /* "View.MemoryView":906
15284  * suboffset_dim[0] = new_ndim
15285  *
15286  * return 0 # <<<<<<<<<<<<<<
15287  *
15288  *
15289  */
15290  __Pyx_TraceLine(906,1,__PYX_ERR(2, 906, __pyx_L1_error))
15291  __pyx_r = 0;
15292  goto __pyx_L0;
15293 
15294  /* "View.MemoryView":809
15295  *
15296  * @cname('__pyx_memoryview_slice_memviewslice')
15297  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15298  * __Pyx_memviewslice *dst,
15299  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15300  */
15301 
15302  /* function exit code */
15303  __pyx_L1_error:;
15304  {
15305  #ifdef WITH_THREAD
15306  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15307  #endif
15308  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15309  #ifdef WITH_THREAD
15310  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15311  #endif
15312  }
15313  __pyx_r = -1;
15314  __pyx_L0:;
15315  __Pyx_TraceReturn(Py_None, 1);
15316  return __pyx_r;
15317 }
15318 
15319 /* "View.MemoryView":912
15320  *
15321  * @cname('__pyx_pybuffer_index')
15322  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15323  * Py_ssize_t dim) except NULL:
15324  * cdef Py_ssize_t shape, stride, suboffset = -1
15325  */
15326 
15327 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
15328  Py_ssize_t __pyx_v_shape;
15329  Py_ssize_t __pyx_v_stride;
15330  Py_ssize_t __pyx_v_suboffset;
15331  Py_ssize_t __pyx_v_itemsize;
15332  char *__pyx_v_resultp;
15333  char *__pyx_r;
15334  __Pyx_TraceDeclarations
15335  __Pyx_RefNannyDeclarations
15336  Py_ssize_t __pyx_t_1;
15337  int __pyx_t_2;
15338  PyObject *__pyx_t_3 = NULL;
15339  PyObject *__pyx_t_4 = NULL;
15340  int __pyx_lineno = 0;
15341  const char *__pyx_filename = NULL;
15342  int __pyx_clineno = 0;
15343  __Pyx_RefNannySetupContext("pybuffer_index", 0);
15344  __Pyx_TraceCall("pybuffer_index", __pyx_f[2], 912, 0, __PYX_ERR(2, 912, __pyx_L1_error));
15345 
15346  /* "View.MemoryView":914
15347  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
15348  * Py_ssize_t dim) except NULL:
15349  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
15350  * cdef Py_ssize_t itemsize = view.itemsize
15351  * cdef char *resultp
15352  */
15353  __Pyx_TraceLine(914,0,__PYX_ERR(2, 914, __pyx_L1_error))
15354  __pyx_v_suboffset = -1L;
15355 
15356  /* "View.MemoryView":915
15357  * Py_ssize_t dim) except NULL:
15358  * cdef Py_ssize_t shape, stride, suboffset = -1
15359  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
15360  * cdef char *resultp
15361  *
15362  */
15363  __Pyx_TraceLine(915,0,__PYX_ERR(2, 915, __pyx_L1_error))
15364  __pyx_t_1 = __pyx_v_view->itemsize;
15365  __pyx_v_itemsize = __pyx_t_1;
15366 
15367  /* "View.MemoryView":918
15368  * cdef char *resultp
15369  *
15370  * if view.ndim == 0: # <<<<<<<<<<<<<<
15371  * shape = view.len / itemsize
15372  * stride = itemsize
15373  */
15374  __Pyx_TraceLine(918,0,__PYX_ERR(2, 918, __pyx_L1_error))
15375  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
15376  if (__pyx_t_2) {
15377 
15378  /* "View.MemoryView":919
15379  *
15380  * if view.ndim == 0:
15381  * shape = view.len / itemsize # <<<<<<<<<<<<<<
15382  * stride = itemsize
15383  * else:
15384  */
15385  __Pyx_TraceLine(919,0,__PYX_ERR(2, 919, __pyx_L1_error))
15386  if (unlikely(__pyx_v_itemsize == 0)) {
15387  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
15388  __PYX_ERR(2, 919, __pyx_L1_error)
15389  }
15390  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
15391  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
15392  __PYX_ERR(2, 919, __pyx_L1_error)
15393  }
15394  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
15395 
15396  /* "View.MemoryView":920
15397  * if view.ndim == 0:
15398  * shape = view.len / itemsize
15399  * stride = itemsize # <<<<<<<<<<<<<<
15400  * else:
15401  * shape = view.shape[dim]
15402  */
15403  __Pyx_TraceLine(920,0,__PYX_ERR(2, 920, __pyx_L1_error))
15404  __pyx_v_stride = __pyx_v_itemsize;
15405 
15406  /* "View.MemoryView":918
15407  * cdef char *resultp
15408  *
15409  * if view.ndim == 0: # <<<<<<<<<<<<<<
15410  * shape = view.len / itemsize
15411  * stride = itemsize
15412  */
15413  goto __pyx_L3;
15414  }
15415 
15416  /* "View.MemoryView":922
15417  * stride = itemsize
15418  * else:
15419  * shape = view.shape[dim] # <<<<<<<<<<<<<<
15420  * stride = view.strides[dim]
15421  * if view.suboffsets != NULL:
15422  */
15423  __Pyx_TraceLine(922,0,__PYX_ERR(2, 922, __pyx_L1_error))
15424  /*else*/ {
15425  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15426 
15427  /* "View.MemoryView":923
15428  * else:
15429  * shape = view.shape[dim]
15430  * stride = view.strides[dim] # <<<<<<<<<<<<<<
15431  * if view.suboffsets != NULL:
15432  * suboffset = view.suboffsets[dim]
15433  */
15434  __Pyx_TraceLine(923,0,__PYX_ERR(2, 923, __pyx_L1_error))
15435  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15436 
15437  /* "View.MemoryView":924
15438  * shape = view.shape[dim]
15439  * stride = view.strides[dim]
15440  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15441  * suboffset = view.suboffsets[dim]
15442  *
15443  */
15444  __Pyx_TraceLine(924,0,__PYX_ERR(2, 924, __pyx_L1_error))
15445  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
15446  if (__pyx_t_2) {
15447 
15448  /* "View.MemoryView":925
15449  * stride = view.strides[dim]
15450  * if view.suboffsets != NULL:
15451  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
15452  *
15453  * if index < 0:
15454  */
15455  __Pyx_TraceLine(925,0,__PYX_ERR(2, 925, __pyx_L1_error))
15456  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15457 
15458  /* "View.MemoryView":924
15459  * shape = view.shape[dim]
15460  * stride = view.strides[dim]
15461  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15462  * suboffset = view.suboffsets[dim]
15463  *
15464  */
15465  }
15466  }
15467  __pyx_L3:;
15468 
15469  /* "View.MemoryView":927
15470  * suboffset = view.suboffsets[dim]
15471  *
15472  * if index < 0: # <<<<<<<<<<<<<<
15473  * index += view.shape[dim]
15474  * if index < 0:
15475  */
15476  __Pyx_TraceLine(927,0,__PYX_ERR(2, 927, __pyx_L1_error))
15477  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15478  if (__pyx_t_2) {
15479 
15480  /* "View.MemoryView":928
15481  *
15482  * if index < 0:
15483  * index += view.shape[dim] # <<<<<<<<<<<<<<
15484  * if index < 0:
15485  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15486  */
15487  __Pyx_TraceLine(928,0,__PYX_ERR(2, 928, __pyx_L1_error))
15488  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15489 
15490  /* "View.MemoryView":929
15491  * if index < 0:
15492  * index += view.shape[dim]
15493  * if index < 0: # <<<<<<<<<<<<<<
15494  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15495  *
15496  */
15497  __Pyx_TraceLine(929,0,__PYX_ERR(2, 929, __pyx_L1_error))
15498  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15499  if (unlikely(__pyx_t_2)) {
15500 
15501  /* "View.MemoryView":930
15502  * index += view.shape[dim]
15503  * if index < 0:
15504  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15505  *
15506  * if index >= shape:
15507  */
15508  __Pyx_TraceLine(930,0,__PYX_ERR(2, 930, __pyx_L1_error))
15509  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error)
15510  __Pyx_GOTREF(__pyx_t_3);
15511  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 930, __pyx_L1_error)
15512  __Pyx_GOTREF(__pyx_t_4);
15513  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15514  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error)
15515  __Pyx_GOTREF(__pyx_t_3);
15516  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15517  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15518  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15519  __PYX_ERR(2, 930, __pyx_L1_error)
15520 
15521  /* "View.MemoryView":929
15522  * if index < 0:
15523  * index += view.shape[dim]
15524  * if index < 0: # <<<<<<<<<<<<<<
15525  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15526  *
15527  */
15528  }
15529 
15530  /* "View.MemoryView":927
15531  * suboffset = view.suboffsets[dim]
15532  *
15533  * if index < 0: # <<<<<<<<<<<<<<
15534  * index += view.shape[dim]
15535  * if index < 0:
15536  */
15537  }
15538 
15539  /* "View.MemoryView":932
15540  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15541  *
15542  * if index >= shape: # <<<<<<<<<<<<<<
15543  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15544  *
15545  */
15546  __Pyx_TraceLine(932,0,__PYX_ERR(2, 932, __pyx_L1_error))
15547  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
15548  if (unlikely(__pyx_t_2)) {
15549 
15550  /* "View.MemoryView":933
15551  *
15552  * if index >= shape:
15553  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15554  *
15555  * resultp = bufp + index * stride
15556  */
15557  __Pyx_TraceLine(933,0,__PYX_ERR(2, 933, __pyx_L1_error))
15558  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error)
15559  __Pyx_GOTREF(__pyx_t_3);
15560  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 933, __pyx_L1_error)
15561  __Pyx_GOTREF(__pyx_t_4);
15562  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15563  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error)
15564  __Pyx_GOTREF(__pyx_t_3);
15565  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15566  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15567  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15568  __PYX_ERR(2, 933, __pyx_L1_error)
15569 
15570  /* "View.MemoryView":932
15571  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15572  *
15573  * if index >= shape: # <<<<<<<<<<<<<<
15574  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15575  *
15576  */
15577  }
15578 
15579  /* "View.MemoryView":935
15580  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15581  *
15582  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
15583  * if suboffset >= 0:
15584  * resultp = (<char **> resultp)[0] + suboffset
15585  */
15586  __Pyx_TraceLine(935,0,__PYX_ERR(2, 935, __pyx_L1_error))
15587  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15588 
15589  /* "View.MemoryView":936
15590  *
15591  * resultp = bufp + index * stride
15592  * if suboffset >= 0: # <<<<<<<<<<<<<<
15593  * resultp = (<char **> resultp)[0] + suboffset
15594  *
15595  */
15596  __Pyx_TraceLine(936,0,__PYX_ERR(2, 936, __pyx_L1_error))
15597  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15598  if (__pyx_t_2) {
15599 
15600  /* "View.MemoryView":937
15601  * resultp = bufp + index * stride
15602  * if suboffset >= 0:
15603  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
15604  *
15605  * return resultp
15606  */
15607  __Pyx_TraceLine(937,0,__PYX_ERR(2, 937, __pyx_L1_error))
15608  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15609 
15610  /* "View.MemoryView":936
15611  *
15612  * resultp = bufp + index * stride
15613  * if suboffset >= 0: # <<<<<<<<<<<<<<
15614  * resultp = (<char **> resultp)[0] + suboffset
15615  *
15616  */
15617  }
15618 
15619  /* "View.MemoryView":939
15620  * resultp = (<char **> resultp)[0] + suboffset
15621  *
15622  * return resultp # <<<<<<<<<<<<<<
15623  *
15624  *
15625  */
15626  __Pyx_TraceLine(939,0,__PYX_ERR(2, 939, __pyx_L1_error))
15627  __pyx_r = __pyx_v_resultp;
15628  goto __pyx_L0;
15629 
15630  /* "View.MemoryView":912
15631  *
15632  * @cname('__pyx_pybuffer_index')
15633  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15634  * Py_ssize_t dim) except NULL:
15635  * cdef Py_ssize_t shape, stride, suboffset = -1
15636  */
15637 
15638  /* function exit code */
15639  __pyx_L1_error:;
15640  __Pyx_XDECREF(__pyx_t_3);
15641  __Pyx_XDECREF(__pyx_t_4);
15642  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15643  __pyx_r = NULL;
15644  __pyx_L0:;
15645  __Pyx_TraceReturn(Py_None, 0);
15646  __Pyx_RefNannyFinishContext();
15647  return __pyx_r;
15648 }
15649 
15650 /* "View.MemoryView":945
15651  *
15652  * @cname('__pyx_memslice_transpose')
15653  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
15654  * cdef int ndim = memslice.memview.view.ndim
15655  *
15656  */
15657 
15658 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15659  int __pyx_v_ndim;
15660  Py_ssize_t *__pyx_v_shape;
15661  Py_ssize_t *__pyx_v_strides;
15662  int __pyx_v_i;
15663  int __pyx_v_j;
15664  int __pyx_r;
15665  __Pyx_TraceDeclarations
15666  int __pyx_t_1;
15667  Py_ssize_t *__pyx_t_2;
15668  long __pyx_t_3;
15669  long __pyx_t_4;
15670  Py_ssize_t __pyx_t_5;
15671  Py_ssize_t __pyx_t_6;
15672  int __pyx_t_7;
15673  int __pyx_t_8;
15674  int __pyx_t_9;
15675  int __pyx_lineno = 0;
15676  const char *__pyx_filename = NULL;
15677  int __pyx_clineno = 0;
15678  __Pyx_TraceCall("transpose_memslice", __pyx_f[2], 945, 1, __PYX_ERR(2, 945, __pyx_L1_error));
15679 
15680  /* "View.MemoryView":946
15681  * @cname('__pyx_memslice_transpose')
15682  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
15683  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
15684  *
15685  * cdef Py_ssize_t *shape = memslice.shape
15686  */
15687  __Pyx_TraceLine(946,1,__PYX_ERR(2, 946, __pyx_L1_error))
15688  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15689  __pyx_v_ndim = __pyx_t_1;
15690 
15691  /* "View.MemoryView":948
15692  * cdef int ndim = memslice.memview.view.ndim
15693  *
15694  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
15695  * cdef Py_ssize_t *strides = memslice.strides
15696  *
15697  */
15698  __Pyx_TraceLine(948,1,__PYX_ERR(2, 948, __pyx_L1_error))
15699  __pyx_t_2 = __pyx_v_memslice->shape;
15700  __pyx_v_shape = __pyx_t_2;
15701 
15702  /* "View.MemoryView":949
15703  *
15704  * cdef Py_ssize_t *shape = memslice.shape
15705  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
15706  *
15707  *
15708  */
15709  __Pyx_TraceLine(949,1,__PYX_ERR(2, 949, __pyx_L1_error))
15710  __pyx_t_2 = __pyx_v_memslice->strides;
15711  __pyx_v_strides = __pyx_t_2;
15712 
15713  /* "View.MemoryView":953
15714  *
15715  * cdef int i, j
15716  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
15717  * j = ndim - 1 - i
15718  * strides[i], strides[j] = strides[j], strides[i]
15719  */
15720  __Pyx_TraceLine(953,1,__PYX_ERR(2, 953, __pyx_L1_error))
15721  __pyx_t_3 = (__pyx_v_ndim / 2);
15722  __pyx_t_4 = __pyx_t_3;
15723  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15724  __pyx_v_i = __pyx_t_1;
15725 
15726  /* "View.MemoryView":954
15727  * cdef int i, j
15728  * for i in range(ndim / 2):
15729  * j = ndim - 1 - i # <<<<<<<<<<<<<<
15730  * strides[i], strides[j] = strides[j], strides[i]
15731  * shape[i], shape[j] = shape[j], shape[i]
15732  */
15733  __Pyx_TraceLine(954,1,__PYX_ERR(2, 954, __pyx_L1_error))
15734  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15735 
15736  /* "View.MemoryView":955
15737  * for i in range(ndim / 2):
15738  * j = ndim - 1 - i
15739  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
15740  * shape[i], shape[j] = shape[j], shape[i]
15741  *
15742  */
15743  __Pyx_TraceLine(955,1,__PYX_ERR(2, 955, __pyx_L1_error))
15744  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15745  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15746  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15747  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15748 
15749  /* "View.MemoryView":956
15750  * j = ndim - 1 - i
15751  * strides[i], strides[j] = strides[j], strides[i]
15752  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
15753  *
15754  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15755  */
15756  __Pyx_TraceLine(956,1,__PYX_ERR(2, 956, __pyx_L1_error))
15757  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15758  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15759  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15760  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15761 
15762  /* "View.MemoryView":958
15763  * shape[i], shape[j] = shape[j], shape[i]
15764  *
15765  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15766  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15767  *
15768  */
15769  __Pyx_TraceLine(958,1,__PYX_ERR(2, 958, __pyx_L1_error))
15770  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
15771  if (!__pyx_t_8) {
15772  } else {
15773  __pyx_t_7 = __pyx_t_8;
15774  goto __pyx_L6_bool_binop_done;
15775  }
15776  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
15777  __pyx_t_7 = __pyx_t_8;
15778  __pyx_L6_bool_binop_done:;
15779  if (__pyx_t_7) {
15780 
15781  /* "View.MemoryView":959
15782  *
15783  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15784  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
15785  *
15786  * return 1
15787  */
15788  __Pyx_TraceLine(959,1,__PYX_ERR(2, 959, __pyx_L1_error))
15789  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 959, __pyx_L1_error)
15790 
15791  /* "View.MemoryView":958
15792  * shape[i], shape[j] = shape[j], shape[i]
15793  *
15794  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15795  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15796  *
15797  */
15798  }
15799  }
15800 
15801  /* "View.MemoryView":961
15802  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15803  *
15804  * return 1 # <<<<<<<<<<<<<<
15805  *
15806  *
15807  */
15808  __Pyx_TraceLine(961,1,__PYX_ERR(2, 961, __pyx_L1_error))
15809  __pyx_r = 1;
15810  goto __pyx_L0;
15811 
15812  /* "View.MemoryView":945
15813  *
15814  * @cname('__pyx_memslice_transpose')
15815  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
15816  * cdef int ndim = memslice.memview.view.ndim
15817  *
15818  */
15819 
15820  /* function exit code */
15821  __pyx_L1_error:;
15822  {
15823  #ifdef WITH_THREAD
15824  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15825  #endif
15826  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15827  #ifdef WITH_THREAD
15828  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15829  #endif
15830  }
15831  __pyx_r = 0;
15832  __pyx_L0:;
15833  __Pyx_TraceReturn(Py_None, 1);
15834  return __pyx_r;
15835 }
15836 
15837 /* "View.MemoryView":978
15838  * cdef int (*to_dtype_func)(char *, object) except 0
15839  *
15840  * def __dealloc__(self): # <<<<<<<<<<<<<<
15841  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15842  *
15843  */
15844 
15845 /* Python wrapper */
15846 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
15847 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15848  __Pyx_RefNannyDeclarations
15849  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15850  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15851 
15852  /* function exit code */
15853  __Pyx_RefNannyFinishContext();
15854 }
15855 
15856 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15857  __Pyx_TraceDeclarations
15858  __Pyx_RefNannyDeclarations
15859  int __pyx_lineno = 0;
15860  const char *__pyx_filename = NULL;
15861  int __pyx_clineno = 0;
15862  __Pyx_RefNannySetupContext("__dealloc__", 0);
15863  __Pyx_TraceCall("__dealloc__", __pyx_f[2], 978, 0, __PYX_ERR(2, 978, __pyx_L1_error));
15864 
15865  /* "View.MemoryView":979
15866  *
15867  * def __dealloc__(self):
15868  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15869  *
15870  * cdef convert_item_to_object(self, char *itemp):
15871  */
15872  __Pyx_TraceLine(979,0,__PYX_ERR(2, 979, __pyx_L1_error))
15873  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
15874 
15875  /* "View.MemoryView":978
15876  * cdef int (*to_dtype_func)(char *, object) except 0
15877  *
15878  * def __dealloc__(self): # <<<<<<<<<<<<<<
15879  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15880  *
15881  */
15882 
15883  /* function exit code */
15884  goto __pyx_L0;
15885  __pyx_L1_error:;
15886  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
15887  __pyx_L0:;
15888  __Pyx_TraceReturn(Py_None, 0);
15889  __Pyx_RefNannyFinishContext();
15890 }
15891 
15892 /* "View.MemoryView":981
15893  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15894  *
15895  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15896  * if self.to_object_func != NULL:
15897  * return self.to_object_func(itemp)
15898  */
15899 
15900 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15901  PyObject *__pyx_r = NULL;
15902  __Pyx_TraceDeclarations
15903  __Pyx_RefNannyDeclarations
15904  int __pyx_t_1;
15905  PyObject *__pyx_t_2 = NULL;
15906  int __pyx_lineno = 0;
15907  const char *__pyx_filename = NULL;
15908  int __pyx_clineno = 0;
15909  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
15910  __Pyx_TraceCall("convert_item_to_object", __pyx_f[2], 981, 0, __PYX_ERR(2, 981, __pyx_L1_error));
15911 
15912  /* "View.MemoryView":982
15913  *
15914  * cdef convert_item_to_object(self, char *itemp):
15915  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15916  * return self.to_object_func(itemp)
15917  * else:
15918  */
15919  __Pyx_TraceLine(982,0,__PYX_ERR(2, 982, __pyx_L1_error))
15920  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
15921  if (__pyx_t_1) {
15922 
15923  /* "View.MemoryView":983
15924  * cdef convert_item_to_object(self, char *itemp):
15925  * if self.to_object_func != NULL:
15926  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
15927  * else:
15928  * return memoryview.convert_item_to_object(self, itemp)
15929  */
15930  __Pyx_TraceLine(983,0,__PYX_ERR(2, 983, __pyx_L1_error))
15931  __Pyx_XDECREF(__pyx_r);
15932  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
15933  __Pyx_GOTREF(__pyx_t_2);
15934  __pyx_r = __pyx_t_2;
15935  __pyx_t_2 = 0;
15936  goto __pyx_L0;
15937 
15938  /* "View.MemoryView":982
15939  *
15940  * cdef convert_item_to_object(self, char *itemp):
15941  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15942  * return self.to_object_func(itemp)
15943  * else:
15944  */
15945  }
15946 
15947  /* "View.MemoryView":985
15948  * return self.to_object_func(itemp)
15949  * else:
15950  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15951  *
15952  * cdef assign_item_from_object(self, char *itemp, object value):
15953  */
15954  __Pyx_TraceLine(985,0,__PYX_ERR(2, 985, __pyx_L1_error))
15955  /*else*/ {
15956  __Pyx_XDECREF(__pyx_r);
15957  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 985, __pyx_L1_error)
15958  __Pyx_GOTREF(__pyx_t_2);
15959  __pyx_r = __pyx_t_2;
15960  __pyx_t_2 = 0;
15961  goto __pyx_L0;
15962  }
15963 
15964  /* "View.MemoryView":981
15965  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15966  *
15967  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15968  * if self.to_object_func != NULL:
15969  * return self.to_object_func(itemp)
15970  */
15971 
15972  /* function exit code */
15973  __pyx_L1_error:;
15974  __Pyx_XDECREF(__pyx_t_2);
15975  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15976  __pyx_r = 0;
15977  __pyx_L0:;
15978  __Pyx_XGIVEREF(__pyx_r);
15979  __Pyx_TraceReturn(__pyx_r, 0);
15980  __Pyx_RefNannyFinishContext();
15981  return __pyx_r;
15982 }
15983 
15984 /* "View.MemoryView":987
15985  * return memoryview.convert_item_to_object(self, itemp)
15986  *
15987  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15988  * if self.to_dtype_func != NULL:
15989  * self.to_dtype_func(itemp, value)
15990  */
15991 
15992 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15993  PyObject *__pyx_r = NULL;
15994  __Pyx_TraceDeclarations
15995  __Pyx_RefNannyDeclarations
15996  int __pyx_t_1;
15997  int __pyx_t_2;
15998  PyObject *__pyx_t_3 = NULL;
15999  int __pyx_lineno = 0;
16000  const char *__pyx_filename = NULL;
16001  int __pyx_clineno = 0;
16002  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16003  __Pyx_TraceCall("assign_item_from_object", __pyx_f[2], 987, 0, __PYX_ERR(2, 987, __pyx_L1_error));
16004 
16005  /* "View.MemoryView":988
16006  *
16007  * cdef assign_item_from_object(self, char *itemp, object value):
16008  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16009  * self.to_dtype_func(itemp, value)
16010  * else:
16011  */
16012  __Pyx_TraceLine(988,0,__PYX_ERR(2, 988, __pyx_L1_error))
16013  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16014  if (__pyx_t_1) {
16015 
16016  /* "View.MemoryView":989
16017  * cdef assign_item_from_object(self, char *itemp, object value):
16018  * if self.to_dtype_func != NULL:
16019  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16020  * else:
16021  * memoryview.assign_item_from_object(self, itemp, value)
16022  */
16023  __Pyx_TraceLine(989,0,__PYX_ERR(2, 989, __pyx_L1_error))
16024  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 989, __pyx_L1_error)
16025 
16026  /* "View.MemoryView":988
16027  *
16028  * cdef assign_item_from_object(self, char *itemp, object value):
16029  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16030  * self.to_dtype_func(itemp, value)
16031  * else:
16032  */
16033  goto __pyx_L3;
16034  }
16035 
16036  /* "View.MemoryView":991
16037  * self.to_dtype_func(itemp, value)
16038  * else:
16039  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16040  *
16041  * @property
16042  */
16043  __Pyx_TraceLine(991,0,__PYX_ERR(2, 991, __pyx_L1_error))
16044  /*else*/ {
16045  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 991, __pyx_L1_error)
16046  __Pyx_GOTREF(__pyx_t_3);
16047  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16048  }
16049  __pyx_L3:;
16050 
16051  /* "View.MemoryView":987
16052  * return memoryview.convert_item_to_object(self, itemp)
16053  *
16054  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16055  * if self.to_dtype_func != NULL:
16056  * self.to_dtype_func(itemp, value)
16057  */
16058 
16059  /* function exit code */
16060  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16061  goto __pyx_L0;
16062  __pyx_L1_error:;
16063  __Pyx_XDECREF(__pyx_t_3);
16064  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16065  __pyx_r = 0;
16066  __pyx_L0:;
16067  __Pyx_XGIVEREF(__pyx_r);
16068  __Pyx_TraceReturn(__pyx_r, 0);
16069  __Pyx_RefNannyFinishContext();
16070  return __pyx_r;
16071 }
16072 
16073 /* "View.MemoryView":994
16074  *
16075  * @property
16076  * def base(self): # <<<<<<<<<<<<<<
16077  * return self.from_object
16078  *
16079  */
16080 
16081 /* Python wrapper */
16082 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16083 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16084  PyObject *__pyx_r = 0;
16085  __Pyx_RefNannyDeclarations
16086  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16087  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16088 
16089  /* function exit code */
16090  __Pyx_RefNannyFinishContext();
16091  return __pyx_r;
16092 }
16093 
16094 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16095  PyObject *__pyx_r = NULL;
16096  __Pyx_TraceDeclarations
16097  __Pyx_RefNannyDeclarations
16098  int __pyx_lineno = 0;
16099  const char *__pyx_filename = NULL;
16100  int __pyx_clineno = 0;
16101  __Pyx_RefNannySetupContext("__get__", 0);
16102  __Pyx_TraceCall("__get__", __pyx_f[2], 994, 0, __PYX_ERR(2, 994, __pyx_L1_error));
16103 
16104  /* "View.MemoryView":995
16105  * @property
16106  * def base(self):
16107  * return self.from_object # <<<<<<<<<<<<<<
16108  *
16109  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16110  */
16111  __Pyx_TraceLine(995,0,__PYX_ERR(2, 995, __pyx_L1_error))
16112  __Pyx_XDECREF(__pyx_r);
16113  __Pyx_INCREF(__pyx_v_self->from_object);
16114  __pyx_r = __pyx_v_self->from_object;
16115  goto __pyx_L0;
16116 
16117  /* "View.MemoryView":994
16118  *
16119  * @property
16120  * def base(self): # <<<<<<<<<<<<<<
16121  * return self.from_object
16122  *
16123  */
16124 
16125  /* function exit code */
16126  __pyx_L1_error:;
16127  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16128  __pyx_r = NULL;
16129  __pyx_L0:;
16130  __Pyx_XGIVEREF(__pyx_r);
16131  __Pyx_TraceReturn(__pyx_r, 0);
16132  __Pyx_RefNannyFinishContext();
16133  return __pyx_r;
16134 }
16135 
16136 /* "(tree fragment)":1
16137  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16138  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16139  * def __setstate_cython__(self, __pyx_state):
16140  */
16141 
16142 /* Python wrapper */
16143 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16144 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
16145 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16146  PyObject *__pyx_r = 0;
16147  __Pyx_RefNannyDeclarations
16148  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16149  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16150 
16151  /* function exit code */
16152  __Pyx_RefNannyFinishContext();
16153  return __pyx_r;
16154 }
16155 
16156 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16157  PyObject *__pyx_r = NULL;
16158  __Pyx_TraceDeclarations
16159  __Pyx_RefNannyDeclarations
16160  PyObject *__pyx_t_1 = NULL;
16161  int __pyx_lineno = 0;
16162  const char *__pyx_filename = NULL;
16163  int __pyx_clineno = 0;
16164  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
16165  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
16166 
16167  /* "(tree fragment)":2
16168  * def __reduce_cython__(self):
16169  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16170  * def __setstate_cython__(self, __pyx_state):
16171  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16172  */
16173  __Pyx_TraceLine(2,0,__PYX_ERR(2, 2, __pyx_L1_error))
16174  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
16175  __Pyx_GOTREF(__pyx_t_1);
16176  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16177  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16178  __PYX_ERR(2, 2, __pyx_L1_error)
16179 
16180  /* "(tree fragment)":1
16181  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16182  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16183  * def __setstate_cython__(self, __pyx_state):
16184  */
16185 
16186  /* function exit code */
16187  __pyx_L1_error:;
16188  __Pyx_XDECREF(__pyx_t_1);
16189  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16190  __pyx_r = NULL;
16191  __Pyx_XGIVEREF(__pyx_r);
16192  __Pyx_TraceReturn(__pyx_r, 0);
16193  __Pyx_RefNannyFinishContext();
16194  return __pyx_r;
16195 }
16196 
16197 /* "(tree fragment)":3
16198  * def __reduce_cython__(self):
16199  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16200  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16201  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16202  */
16203 
16204 /* Python wrapper */
16205 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
16206 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
16207 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16208  PyObject *__pyx_r = 0;
16209  __Pyx_RefNannyDeclarations
16210  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16211  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16212 
16213  /* function exit code */
16214  __Pyx_RefNannyFinishContext();
16215  return __pyx_r;
16216 }
16217 
16218 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16219  PyObject *__pyx_r = NULL;
16220  __Pyx_TraceDeclarations
16221  __Pyx_RefNannyDeclarations
16222  PyObject *__pyx_t_1 = NULL;
16223  int __pyx_lineno = 0;
16224  const char *__pyx_filename = NULL;
16225  int __pyx_clineno = 0;
16226  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
16227  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 3, 0, __PYX_ERR(2, 3, __pyx_L1_error));
16228 
16229  /* "(tree fragment)":4
16230  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16231  * def __setstate_cython__(self, __pyx_state):
16232  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16233  */
16234  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
16235  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
16236  __Pyx_GOTREF(__pyx_t_1);
16237  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16238  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16239  __PYX_ERR(2, 4, __pyx_L1_error)
16240 
16241  /* "(tree fragment)":3
16242  * def __reduce_cython__(self):
16243  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16244  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16245  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16246  */
16247 
16248  /* function exit code */
16249  __pyx_L1_error:;
16250  __Pyx_XDECREF(__pyx_t_1);
16251  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16252  __pyx_r = NULL;
16253  __Pyx_XGIVEREF(__pyx_r);
16254  __Pyx_TraceReturn(__pyx_r, 0);
16255  __Pyx_RefNannyFinishContext();
16256  return __pyx_r;
16257 }
16258 
16259 /* "View.MemoryView":1001
16260  *
16261  * @cname('__pyx_memoryview_fromslice')
16262  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16263  * int ndim,
16264  * object (*to_object_func)(char *),
16265  */
16266 
16267 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
16268  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16269  Py_ssize_t __pyx_v_suboffset;
16270  PyObject *__pyx_v_length = NULL;
16271  PyObject *__pyx_r = NULL;
16272  __Pyx_TraceDeclarations
16273  __Pyx_RefNannyDeclarations
16274  int __pyx_t_1;
16275  PyObject *__pyx_t_2 = NULL;
16276  PyObject *__pyx_t_3 = NULL;
16277  __Pyx_TypeInfo *__pyx_t_4;
16278  Py_buffer __pyx_t_5;
16279  Py_ssize_t *__pyx_t_6;
16280  Py_ssize_t *__pyx_t_7;
16281  Py_ssize_t *__pyx_t_8;
16282  Py_ssize_t __pyx_t_9;
16283  int __pyx_lineno = 0;
16284  const char *__pyx_filename = NULL;
16285  int __pyx_clineno = 0;
16286  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
16287  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[2], 1001, 0, __PYX_ERR(2, 1001, __pyx_L1_error));
16288 
16289  /* "View.MemoryView":1009
16290  * cdef _memoryviewslice result
16291  *
16292  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16293  * return None
16294  *
16295  */
16296  __Pyx_TraceLine(1009,0,__PYX_ERR(2, 1009, __pyx_L1_error))
16297  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16298  if (__pyx_t_1) {
16299 
16300  /* "View.MemoryView":1010
16301  *
16302  * if <PyObject *> memviewslice.memview == Py_None:
16303  * return None # <<<<<<<<<<<<<<
16304  *
16305  *
16306  */
16307  __Pyx_TraceLine(1010,0,__PYX_ERR(2, 1010, __pyx_L1_error))
16308  __Pyx_XDECREF(__pyx_r);
16309  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16310  goto __pyx_L0;
16311 
16312  /* "View.MemoryView":1009
16313  * cdef _memoryviewslice result
16314  *
16315  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16316  * return None
16317  *
16318  */
16319  }
16320 
16321  /* "View.MemoryView":1015
16322  *
16323  *
16324  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
16325  *
16326  * result.from_slice = memviewslice
16327  */
16328  __Pyx_TraceLine(1015,0,__PYX_ERR(2, 1015, __pyx_L1_error))
16329  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error)
16330  __Pyx_GOTREF(__pyx_t_2);
16331  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1015, __pyx_L1_error)
16332  __Pyx_GOTREF(__pyx_t_3);
16333  __Pyx_INCREF(Py_None);
16334  __Pyx_GIVEREF(Py_None);
16335  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
16336  __Pyx_INCREF(__pyx_int_0);
16337  __Pyx_GIVEREF(__pyx_int_0);
16338  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
16339  __Pyx_GIVEREF(__pyx_t_2);
16340  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16341  __pyx_t_2 = 0;
16342  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error)
16343  __Pyx_GOTREF(__pyx_t_2);
16344  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16345  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16346  __pyx_t_2 = 0;
16347 
16348  /* "View.MemoryView":1017
16349  * result = _memoryviewslice(None, 0, dtype_is_object)
16350  *
16351  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
16352  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16353  *
16354  */
16355  __Pyx_TraceLine(1017,0,__PYX_ERR(2, 1017, __pyx_L1_error))
16356  __pyx_v_result->from_slice = __pyx_v_memviewslice;
16357 
16358  /* "View.MemoryView":1018
16359  *
16360  * result.from_slice = memviewslice
16361  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
16362  *
16363  * result.from_object = (<memoryview> memviewslice.memview).base
16364  */
16365  __Pyx_TraceLine(1018,0,__PYX_ERR(2, 1018, __pyx_L1_error))
16366  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16367 
16368  /* "View.MemoryView":1020
16369  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16370  *
16371  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
16372  * result.typeinfo = memviewslice.memview.typeinfo
16373  *
16374  */
16375  __Pyx_TraceLine(1020,0,__PYX_ERR(2, 1020, __pyx_L1_error))
16376  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1020, __pyx_L1_error)
16377  __Pyx_GOTREF(__pyx_t_2);
16378  __Pyx_GIVEREF(__pyx_t_2);
16379  __Pyx_GOTREF(__pyx_v_result->from_object);
16380  __Pyx_DECREF(__pyx_v_result->from_object);
16381  __pyx_v_result->from_object = __pyx_t_2;
16382  __pyx_t_2 = 0;
16383 
16384  /* "View.MemoryView":1021
16385  *
16386  * result.from_object = (<memoryview> memviewslice.memview).base
16387  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
16388  *
16389  * result.view = memviewslice.memview.view
16390  */
16391  __Pyx_TraceLine(1021,0,__PYX_ERR(2, 1021, __pyx_L1_error))
16392  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16393  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16394 
16395  /* "View.MemoryView":1023
16396  * result.typeinfo = memviewslice.memview.typeinfo
16397  *
16398  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
16399  * result.view.buf = <void *> memviewslice.data
16400  * result.view.ndim = ndim
16401  */
16402  __Pyx_TraceLine(1023,0,__PYX_ERR(2, 1023, __pyx_L1_error))
16403  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16404  __pyx_v_result->__pyx_base.view = __pyx_t_5;
16405 
16406  /* "View.MemoryView":1024
16407  *
16408  * result.view = memviewslice.memview.view
16409  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
16410  * result.view.ndim = ndim
16411  * (<__pyx_buffer *> &result.view).obj = Py_None
16412  */
16413  __Pyx_TraceLine(1024,0,__PYX_ERR(2, 1024, __pyx_L1_error))
16414  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
16415 
16416  /* "View.MemoryView":1025
16417  * result.view = memviewslice.memview.view
16418  * result.view.buf = <void *> memviewslice.data
16419  * result.view.ndim = ndim # <<<<<<<<<<<<<<
16420  * (<__pyx_buffer *> &result.view).obj = Py_None
16421  * Py_INCREF(Py_None)
16422  */
16423  __Pyx_TraceLine(1025,0,__PYX_ERR(2, 1025, __pyx_L1_error))
16424  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16425 
16426  /* "View.MemoryView":1026
16427  * result.view.buf = <void *> memviewslice.data
16428  * result.view.ndim = ndim
16429  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
16430  * Py_INCREF(Py_None)
16431  *
16432  */
16433  __Pyx_TraceLine(1026,0,__PYX_ERR(2, 1026, __pyx_L1_error))
16434  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16435 
16436  /* "View.MemoryView":1027
16437  * result.view.ndim = ndim
16438  * (<__pyx_buffer *> &result.view).obj = Py_None
16439  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
16440  *
16441  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16442  */
16443  __Pyx_TraceLine(1027,0,__PYX_ERR(2, 1027, __pyx_L1_error))
16444  Py_INCREF(Py_None);
16445 
16446  /* "View.MemoryView":1029
16447  * Py_INCREF(Py_None)
16448  *
16449  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16450  * result.flags = PyBUF_RECORDS
16451  * else:
16452  */
16453  __Pyx_TraceLine(1029,0,__PYX_ERR(2, 1029, __pyx_L1_error))
16454  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16455  if (__pyx_t_1) {
16456 
16457  /* "View.MemoryView":1030
16458  *
16459  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16460  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
16461  * else:
16462  * result.flags = PyBUF_RECORDS_RO
16463  */
16464  __Pyx_TraceLine(1030,0,__PYX_ERR(2, 1030, __pyx_L1_error))
16465  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16466 
16467  /* "View.MemoryView":1029
16468  * Py_INCREF(Py_None)
16469  *
16470  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16471  * result.flags = PyBUF_RECORDS
16472  * else:
16473  */
16474  goto __pyx_L4;
16475  }
16476 
16477  /* "View.MemoryView":1032
16478  * result.flags = PyBUF_RECORDS
16479  * else:
16480  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
16481  *
16482  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16483  */
16484  __Pyx_TraceLine(1032,0,__PYX_ERR(2, 1032, __pyx_L1_error))
16485  /*else*/ {
16486  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16487  }
16488  __pyx_L4:;
16489 
16490  /* "View.MemoryView":1034
16491  * result.flags = PyBUF_RECORDS_RO
16492  *
16493  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
16494  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
16495  *
16496  */
16497  __Pyx_TraceLine(1034,0,__PYX_ERR(2, 1034, __pyx_L1_error))
16498  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16499 
16500  /* "View.MemoryView":1035
16501  *
16502  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16503  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
16504  *
16505  *
16506  */
16507  __Pyx_TraceLine(1035,0,__PYX_ERR(2, 1035, __pyx_L1_error))
16508  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16509 
16510  /* "View.MemoryView":1038
16511  *
16512  *
16513  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
16514  * for suboffset in result.from_slice.suboffsets[:ndim]:
16515  * if suboffset >= 0:
16516  */
16517  __Pyx_TraceLine(1038,0,__PYX_ERR(2, 1038, __pyx_L1_error))
16518  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16519 
16520  /* "View.MemoryView":1039
16521  *
16522  * result.view.suboffsets = NULL
16523  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
16524  * if suboffset >= 0:
16525  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16526  */
16527  __Pyx_TraceLine(1039,0,__PYX_ERR(2, 1039, __pyx_L1_error))
16528  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16529  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16530  __pyx_t_6 = __pyx_t_8;
16531  __pyx_v_suboffset = (__pyx_t_6[0]);
16532 
16533  /* "View.MemoryView":1040
16534  * result.view.suboffsets = NULL
16535  * for suboffset in result.from_slice.suboffsets[:ndim]:
16536  * if suboffset >= 0: # <<<<<<<<<<<<<<
16537  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16538  * break
16539  */
16540  __Pyx_TraceLine(1040,0,__PYX_ERR(2, 1040, __pyx_L1_error))
16541  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16542  if (__pyx_t_1) {
16543 
16544  /* "View.MemoryView":1041
16545  * for suboffset in result.from_slice.suboffsets[:ndim]:
16546  * if suboffset >= 0:
16547  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
16548  * break
16549  *
16550  */
16551  __Pyx_TraceLine(1041,0,__PYX_ERR(2, 1041, __pyx_L1_error))
16552  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16553 
16554  /* "View.MemoryView":1042
16555  * if suboffset >= 0:
16556  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16557  * break # <<<<<<<<<<<<<<
16558  *
16559  * result.view.len = result.view.itemsize
16560  */
16561  __Pyx_TraceLine(1042,0,__PYX_ERR(2, 1042, __pyx_L1_error))
16562  goto __pyx_L6_break;
16563 
16564  /* "View.MemoryView":1040
16565  * result.view.suboffsets = NULL
16566  * for suboffset in result.from_slice.suboffsets[:ndim]:
16567  * if suboffset >= 0: # <<<<<<<<<<<<<<
16568  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16569  * break
16570  */
16571  }
16572  }
16573  __pyx_L6_break:;
16574 
16575  /* "View.MemoryView":1044
16576  * break
16577  *
16578  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
16579  * for length in result.view.shape[:ndim]:
16580  * result.view.len *= length
16581  */
16582  __Pyx_TraceLine(1044,0,__PYX_ERR(2, 1044, __pyx_L1_error))
16583  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16584  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16585 
16586  /* "View.MemoryView":1045
16587  *
16588  * result.view.len = result.view.itemsize
16589  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
16590  * result.view.len *= length
16591  *
16592  */
16593  __Pyx_TraceLine(1045,0,__PYX_ERR(2, 1045, __pyx_L1_error))
16594  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16595  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16596  __pyx_t_6 = __pyx_t_8;
16597  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1045, __pyx_L1_error)
16598  __Pyx_GOTREF(__pyx_t_2);
16599  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16600  __pyx_t_2 = 0;
16601 
16602  /* "View.MemoryView":1046
16603  * result.view.len = result.view.itemsize
16604  * for length in result.view.shape[:ndim]:
16605  * result.view.len *= length # <<<<<<<<<<<<<<
16606  *
16607  * result.to_object_func = to_object_func
16608  */
16609  __Pyx_TraceLine(1046,0,__PYX_ERR(2, 1046, __pyx_L1_error))
16610  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1046, __pyx_L1_error)
16611  __Pyx_GOTREF(__pyx_t_2);
16612  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1046, __pyx_L1_error)
16613  __Pyx_GOTREF(__pyx_t_3);
16614  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16615  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1046, __pyx_L1_error)
16616  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16617  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16618  }
16619 
16620  /* "View.MemoryView":1048
16621  * result.view.len *= length
16622  *
16623  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
16624  * result.to_dtype_func = to_dtype_func
16625  *
16626  */
16627  __Pyx_TraceLine(1048,0,__PYX_ERR(2, 1048, __pyx_L1_error))
16628  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16629 
16630  /* "View.MemoryView":1049
16631  *
16632  * result.to_object_func = to_object_func
16633  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
16634  *
16635  * return result
16636  */
16637  __Pyx_TraceLine(1049,0,__PYX_ERR(2, 1049, __pyx_L1_error))
16638  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16639 
16640  /* "View.MemoryView":1051
16641  * result.to_dtype_func = to_dtype_func
16642  *
16643  * return result # <<<<<<<<<<<<<<
16644  *
16645  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16646  */
16647  __Pyx_TraceLine(1051,0,__PYX_ERR(2, 1051, __pyx_L1_error))
16648  __Pyx_XDECREF(__pyx_r);
16649  __Pyx_INCREF(((PyObject *)__pyx_v_result));
16650  __pyx_r = ((PyObject *)__pyx_v_result);
16651  goto __pyx_L0;
16652 
16653  /* "View.MemoryView":1001
16654  *
16655  * @cname('__pyx_memoryview_fromslice')
16656  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16657  * int ndim,
16658  * object (*to_object_func)(char *),
16659  */
16660 
16661  /* function exit code */
16662  __pyx_L1_error:;
16663  __Pyx_XDECREF(__pyx_t_2);
16664  __Pyx_XDECREF(__pyx_t_3);
16665  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16666  __pyx_r = 0;
16667  __pyx_L0:;
16668  __Pyx_XDECREF((PyObject *)__pyx_v_result);
16669  __Pyx_XDECREF(__pyx_v_length);
16670  __Pyx_XGIVEREF(__pyx_r);
16671  __Pyx_TraceReturn(__pyx_r, 0);
16672  __Pyx_RefNannyFinishContext();
16673  return __pyx_r;
16674 }
16675 
16676 /* "View.MemoryView":1054
16677  *
16678  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16679  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16680  * __Pyx_memviewslice *mslice) except NULL:
16681  * cdef _memoryviewslice obj
16682  */
16683 
16684 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16685  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16686  __Pyx_memviewslice *__pyx_r;
16687  __Pyx_TraceDeclarations
16688  __Pyx_RefNannyDeclarations
16689  int __pyx_t_1;
16690  int __pyx_t_2;
16691  PyObject *__pyx_t_3 = NULL;
16692  int __pyx_lineno = 0;
16693  const char *__pyx_filename = NULL;
16694  int __pyx_clineno = 0;
16695  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
16696  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[2], 1054, 0, __PYX_ERR(2, 1054, __pyx_L1_error));
16697 
16698  /* "View.MemoryView":1057
16699  * __Pyx_memviewslice *mslice) except NULL:
16700  * cdef _memoryviewslice obj
16701  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16702  * obj = memview
16703  * return &obj.from_slice
16704  */
16705  __Pyx_TraceLine(1057,0,__PYX_ERR(2, 1057, __pyx_L1_error))
16706  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16707  __pyx_t_2 = (__pyx_t_1 != 0);
16708  if (__pyx_t_2) {
16709 
16710  /* "View.MemoryView":1058
16711  * cdef _memoryviewslice obj
16712  * if isinstance(memview, _memoryviewslice):
16713  * obj = memview # <<<<<<<<<<<<<<
16714  * return &obj.from_slice
16715  * else:
16716  */
16717  __Pyx_TraceLine(1058,0,__PYX_ERR(2, 1058, __pyx_L1_error))
16718  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1058, __pyx_L1_error)
16719  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16720  __Pyx_INCREF(__pyx_t_3);
16721  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16722  __pyx_t_3 = 0;
16723 
16724  /* "View.MemoryView":1059
16725  * if isinstance(memview, _memoryviewslice):
16726  * obj = memview
16727  * return &obj.from_slice # <<<<<<<<<<<<<<
16728  * else:
16729  * slice_copy(memview, mslice)
16730  */
16731  __Pyx_TraceLine(1059,0,__PYX_ERR(2, 1059, __pyx_L1_error))
16732  __pyx_r = (&__pyx_v_obj->from_slice);
16733  goto __pyx_L0;
16734 
16735  /* "View.MemoryView":1057
16736  * __Pyx_memviewslice *mslice) except NULL:
16737  * cdef _memoryviewslice obj
16738  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16739  * obj = memview
16740  * return &obj.from_slice
16741  */
16742  }
16743 
16744  /* "View.MemoryView":1061
16745  * return &obj.from_slice
16746  * else:
16747  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
16748  * return mslice
16749  *
16750  */
16751  __Pyx_TraceLine(1061,0,__PYX_ERR(2, 1061, __pyx_L1_error))
16752  /*else*/ {
16753  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16754 
16755  /* "View.MemoryView":1062
16756  * else:
16757  * slice_copy(memview, mslice)
16758  * return mslice # <<<<<<<<<<<<<<
16759  *
16760  * @cname('__pyx_memoryview_slice_copy')
16761  */
16762  __Pyx_TraceLine(1062,0,__PYX_ERR(2, 1062, __pyx_L1_error))
16763  __pyx_r = __pyx_v_mslice;
16764  goto __pyx_L0;
16765  }
16766 
16767  /* "View.MemoryView":1054
16768  *
16769  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16770  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16771  * __Pyx_memviewslice *mslice) except NULL:
16772  * cdef _memoryviewslice obj
16773  */
16774 
16775  /* function exit code */
16776  __pyx_L1_error:;
16777  __Pyx_XDECREF(__pyx_t_3);
16778  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16779  __pyx_r = NULL;
16780  __pyx_L0:;
16781  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16782  __Pyx_TraceReturn(Py_None, 0);
16783  __Pyx_RefNannyFinishContext();
16784  return __pyx_r;
16785 }
16786 
16787 /* "View.MemoryView":1065
16788  *
16789  * @cname('__pyx_memoryview_slice_copy')
16790  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
16791  * cdef int dim
16792  * cdef (Py_ssize_t*) shape, strides, suboffsets
16793  */
16794 
16795 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16796  int __pyx_v_dim;
16797  Py_ssize_t *__pyx_v_shape;
16798  Py_ssize_t *__pyx_v_strides;
16799  Py_ssize_t *__pyx_v_suboffsets;
16800  __Pyx_TraceDeclarations
16801  __Pyx_RefNannyDeclarations
16802  Py_ssize_t *__pyx_t_1;
16803  int __pyx_t_2;
16804  int __pyx_t_3;
16805  int __pyx_t_4;
16806  Py_ssize_t __pyx_t_5;
16807  int __pyx_lineno = 0;
16808  const char *__pyx_filename = NULL;
16809  int __pyx_clineno = 0;
16810  __Pyx_RefNannySetupContext("slice_copy", 0);
16811  __Pyx_TraceCall("slice_copy", __pyx_f[2], 1065, 0, __PYX_ERR(2, 1065, __pyx_L1_error));
16812 
16813  /* "View.MemoryView":1069
16814  * cdef (Py_ssize_t*) shape, strides, suboffsets
16815  *
16816  * shape = memview.view.shape # <<<<<<<<<<<<<<
16817  * strides = memview.view.strides
16818  * suboffsets = memview.view.suboffsets
16819  */
16820  __Pyx_TraceLine(1069,0,__PYX_ERR(2, 1069, __pyx_L1_error))
16821  __pyx_t_1 = __pyx_v_memview->view.shape;
16822  __pyx_v_shape = __pyx_t_1;
16823 
16824  /* "View.MemoryView":1070
16825  *
16826  * shape = memview.view.shape
16827  * strides = memview.view.strides # <<<<<<<<<<<<<<
16828  * suboffsets = memview.view.suboffsets
16829  *
16830  */
16831  __Pyx_TraceLine(1070,0,__PYX_ERR(2, 1070, __pyx_L1_error))
16832  __pyx_t_1 = __pyx_v_memview->view.strides;
16833  __pyx_v_strides = __pyx_t_1;
16834 
16835  /* "View.MemoryView":1071
16836  * shape = memview.view.shape
16837  * strides = memview.view.strides
16838  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
16839  *
16840  * dst.memview = <__pyx_memoryview *> memview
16841  */
16842  __Pyx_TraceLine(1071,0,__PYX_ERR(2, 1071, __pyx_L1_error))
16843  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16844  __pyx_v_suboffsets = __pyx_t_1;
16845 
16846  /* "View.MemoryView":1073
16847  * suboffsets = memview.view.suboffsets
16848  *
16849  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
16850  * dst.data = <char *> memview.view.buf
16851  *
16852  */
16853  __Pyx_TraceLine(1073,0,__PYX_ERR(2, 1073, __pyx_L1_error))
16854  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16855 
16856  /* "View.MemoryView":1074
16857  *
16858  * dst.memview = <__pyx_memoryview *> memview
16859  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
16860  *
16861  * for dim in range(memview.view.ndim):
16862  */
16863  __Pyx_TraceLine(1074,0,__PYX_ERR(2, 1074, __pyx_L1_error))
16864  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16865 
16866  /* "View.MemoryView":1076
16867  * dst.data = <char *> memview.view.buf
16868  *
16869  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
16870  * dst.shape[dim] = shape[dim]
16871  * dst.strides[dim] = strides[dim]
16872  */
16873  __Pyx_TraceLine(1076,0,__PYX_ERR(2, 1076, __pyx_L1_error))
16874  __pyx_t_2 = __pyx_v_memview->view.ndim;
16875  __pyx_t_3 = __pyx_t_2;
16876  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16877  __pyx_v_dim = __pyx_t_4;
16878 
16879  /* "View.MemoryView":1077
16880  *
16881  * for dim in range(memview.view.ndim):
16882  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
16883  * dst.strides[dim] = strides[dim]
16884  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16885  */
16886  __Pyx_TraceLine(1077,0,__PYX_ERR(2, 1077, __pyx_L1_error))
16887  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16888 
16889  /* "View.MemoryView":1078
16890  * for dim in range(memview.view.ndim):
16891  * dst.shape[dim] = shape[dim]
16892  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
16893  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16894  *
16895  */
16896  __Pyx_TraceLine(1078,0,__PYX_ERR(2, 1078, __pyx_L1_error))
16897  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16898 
16899  /* "View.MemoryView":1079
16900  * dst.shape[dim] = shape[dim]
16901  * dst.strides[dim] = strides[dim]
16902  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
16903  *
16904  * @cname('__pyx_memoryview_copy_object')
16905  */
16906  __Pyx_TraceLine(1079,0,__PYX_ERR(2, 1079, __pyx_L1_error))
16907  if ((__pyx_v_suboffsets != 0)) {
16908  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16909  } else {
16910  __pyx_t_5 = -1L;
16911  }
16912  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16913  }
16914 
16915  /* "View.MemoryView":1065
16916  *
16917  * @cname('__pyx_memoryview_slice_copy')
16918  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
16919  * cdef int dim
16920  * cdef (Py_ssize_t*) shape, strides, suboffsets
16921  */
16922 
16923  /* function exit code */
16924  goto __pyx_L0;
16925  __pyx_L1_error:;
16926  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16927  __pyx_L0:;
16928  __Pyx_TraceReturn(Py_None, 0);
16929  __Pyx_RefNannyFinishContext();
16930 }
16931 
16932 /* "View.MemoryView":1082
16933  *
16934  * @cname('__pyx_memoryview_copy_object')
16935  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16936  * "Create a new memoryview object"
16937  * cdef __Pyx_memviewslice memviewslice
16938  */
16939 
16940 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16941  __Pyx_memviewslice __pyx_v_memviewslice;
16942  PyObject *__pyx_r = NULL;
16943  __Pyx_TraceDeclarations
16944  __Pyx_RefNannyDeclarations
16945  PyObject *__pyx_t_1 = NULL;
16946  int __pyx_lineno = 0;
16947  const char *__pyx_filename = NULL;
16948  int __pyx_clineno = 0;
16949  __Pyx_RefNannySetupContext("memoryview_copy", 0);
16950  __Pyx_TraceCall("memoryview_copy", __pyx_f[2], 1082, 0, __PYX_ERR(2, 1082, __pyx_L1_error));
16951 
16952  /* "View.MemoryView":1085
16953  * "Create a new memoryview object"
16954  * cdef __Pyx_memviewslice memviewslice
16955  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
16956  * return memoryview_copy_from_slice(memview, &memviewslice)
16957  *
16958  */
16959  __Pyx_TraceLine(1085,0,__PYX_ERR(2, 1085, __pyx_L1_error))
16960  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16961 
16962  /* "View.MemoryView":1086
16963  * cdef __Pyx_memviewslice memviewslice
16964  * slice_copy(memview, &memviewslice)
16965  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
16966  *
16967  * @cname('__pyx_memoryview_copy_object_from_slice')
16968  */
16969  __Pyx_TraceLine(1086,0,__PYX_ERR(2, 1086, __pyx_L1_error))
16970  __Pyx_XDECREF(__pyx_r);
16971  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1086, __pyx_L1_error)
16972  __Pyx_GOTREF(__pyx_t_1);
16973  __pyx_r = __pyx_t_1;
16974  __pyx_t_1 = 0;
16975  goto __pyx_L0;
16976 
16977  /* "View.MemoryView":1082
16978  *
16979  * @cname('__pyx_memoryview_copy_object')
16980  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16981  * "Create a new memoryview object"
16982  * cdef __Pyx_memviewslice memviewslice
16983  */
16984 
16985  /* function exit code */
16986  __pyx_L1_error:;
16987  __Pyx_XDECREF(__pyx_t_1);
16988  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16989  __pyx_r = 0;
16990  __pyx_L0:;
16991  __Pyx_XGIVEREF(__pyx_r);
16992  __Pyx_TraceReturn(__pyx_r, 0);
16993  __Pyx_RefNannyFinishContext();
16994  return __pyx_r;
16995 }
16996 
16997 /* "View.MemoryView":1089
16998  *
16999  * @cname('__pyx_memoryview_copy_object_from_slice')
17000  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17001  * """
17002  * Create a new memoryview object from a given memoryview object and slice.
17003  */
17004 
17005 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17006  PyObject *(*__pyx_v_to_object_func)(char *);
17007  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
17008  PyObject *__pyx_r = NULL;
17009  __Pyx_TraceDeclarations
17010  __Pyx_RefNannyDeclarations
17011  int __pyx_t_1;
17012  int __pyx_t_2;
17013  PyObject *(*__pyx_t_3)(char *);
17014  int (*__pyx_t_4)(char *, PyObject *);
17015  PyObject *__pyx_t_5 = NULL;
17016  int __pyx_lineno = 0;
17017  const char *__pyx_filename = NULL;
17018  int __pyx_clineno = 0;
17019  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
17020  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[2], 1089, 0, __PYX_ERR(2, 1089, __pyx_L1_error));
17021 
17022  /* "View.MemoryView":1096
17023  * cdef int (*to_dtype_func)(char *, object) except 0
17024  *
17025  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17026  * to_object_func = (<_memoryviewslice> memview).to_object_func
17027  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17028  */
17029  __Pyx_TraceLine(1096,0,__PYX_ERR(2, 1096, __pyx_L1_error))
17030  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17031  __pyx_t_2 = (__pyx_t_1 != 0);
17032  if (__pyx_t_2) {
17033 
17034  /* "View.MemoryView":1097
17035  *
17036  * if isinstance(memview, _memoryviewslice):
17037  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17038  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17039  * else:
17040  */
17041  __Pyx_TraceLine(1097,0,__PYX_ERR(2, 1097, __pyx_L1_error))
17042  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17043  __pyx_v_to_object_func = __pyx_t_3;
17044 
17045  /* "View.MemoryView":1098
17046  * if isinstance(memview, _memoryviewslice):
17047  * to_object_func = (<_memoryviewslice> memview).to_object_func
17048  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17049  * else:
17050  * to_object_func = NULL
17051  */
17052  __Pyx_TraceLine(1098,0,__PYX_ERR(2, 1098, __pyx_L1_error))
17053  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17054  __pyx_v_to_dtype_func = __pyx_t_4;
17055 
17056  /* "View.MemoryView":1096
17057  * cdef int (*to_dtype_func)(char *, object) except 0
17058  *
17059  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17060  * to_object_func = (<_memoryviewslice> memview).to_object_func
17061  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17062  */
17063  goto __pyx_L3;
17064  }
17065 
17066  /* "View.MemoryView":1100
17067  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17068  * else:
17069  * to_object_func = NULL # <<<<<<<<<<<<<<
17070  * to_dtype_func = NULL
17071  *
17072  */
17073  __Pyx_TraceLine(1100,0,__PYX_ERR(2, 1100, __pyx_L1_error))
17074  /*else*/ {
17075  __pyx_v_to_object_func = NULL;
17076 
17077  /* "View.MemoryView":1101
17078  * else:
17079  * to_object_func = NULL
17080  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17081  *
17082  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17083  */
17084  __Pyx_TraceLine(1101,0,__PYX_ERR(2, 1101, __pyx_L1_error))
17085  __pyx_v_to_dtype_func = NULL;
17086  }
17087  __pyx_L3:;
17088 
17089  /* "View.MemoryView":1103
17090  * to_dtype_func = NULL
17091  *
17092  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17093  * to_object_func, to_dtype_func,
17094  * memview.dtype_is_object)
17095  */
17096  __Pyx_TraceLine(1103,0,__PYX_ERR(2, 1103, __pyx_L1_error))
17097  __Pyx_XDECREF(__pyx_r);
17098 
17099  /* "View.MemoryView":1105
17100  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17101  * to_object_func, to_dtype_func,
17102  * memview.dtype_is_object) # <<<<<<<<<<<<<<
17103  *
17104  *
17105  */
17106  __Pyx_TraceLine(1105,0,__PYX_ERR(2, 1105, __pyx_L1_error))
17107  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1103, __pyx_L1_error)
17108  __Pyx_GOTREF(__pyx_t_5);
17109  __pyx_r = __pyx_t_5;
17110  __pyx_t_5 = 0;
17111  goto __pyx_L0;
17112 
17113  /* "View.MemoryView":1089
17114  *
17115  * @cname('__pyx_memoryview_copy_object_from_slice')
17116  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17117  * """
17118  * Create a new memoryview object from a given memoryview object and slice.
17119  */
17120 
17121  /* function exit code */
17122  __pyx_L1_error:;
17123  __Pyx_XDECREF(__pyx_t_5);
17124  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17125  __pyx_r = 0;
17126  __pyx_L0:;
17127  __Pyx_XGIVEREF(__pyx_r);
17128  __Pyx_TraceReturn(__pyx_r, 0);
17129  __Pyx_RefNannyFinishContext();
17130  return __pyx_r;
17131 }
17132 
17133 /* "View.MemoryView":1111
17134  *
17135  *
17136  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17137  * if arg < 0:
17138  * return -arg
17139  */
17140 
17141 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17142  Py_ssize_t __pyx_r;
17143  __Pyx_TraceDeclarations
17144  int __pyx_t_1;
17145  int __pyx_lineno = 0;
17146  const char *__pyx_filename = NULL;
17147  int __pyx_clineno = 0;
17148  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[2], 1111, 1, __PYX_ERR(2, 1111, __pyx_L1_error));
17149 
17150  /* "View.MemoryView":1112
17151  *
17152  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17153  * if arg < 0: # <<<<<<<<<<<<<<
17154  * return -arg
17155  * else:
17156  */
17157  __Pyx_TraceLine(1112,1,__PYX_ERR(2, 1112, __pyx_L1_error))
17158  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17159  if (__pyx_t_1) {
17160 
17161  /* "View.MemoryView":1113
17162  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17163  * if arg < 0:
17164  * return -arg # <<<<<<<<<<<<<<
17165  * else:
17166  * return arg
17167  */
17168  __Pyx_TraceLine(1113,1,__PYX_ERR(2, 1113, __pyx_L1_error))
17169  __pyx_r = (-__pyx_v_arg);
17170  goto __pyx_L0;
17171 
17172  /* "View.MemoryView":1112
17173  *
17174  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17175  * if arg < 0: # <<<<<<<<<<<<<<
17176  * return -arg
17177  * else:
17178  */
17179  }
17180 
17181  /* "View.MemoryView":1115
17182  * return -arg
17183  * else:
17184  * return arg # <<<<<<<<<<<<<<
17185  *
17186  * @cname('__pyx_get_best_slice_order')
17187  */
17188  __Pyx_TraceLine(1115,1,__PYX_ERR(2, 1115, __pyx_L1_error))
17189  /*else*/ {
17190  __pyx_r = __pyx_v_arg;
17191  goto __pyx_L0;
17192  }
17193 
17194  /* "View.MemoryView":1111
17195  *
17196  *
17197  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17198  * if arg < 0:
17199  * return -arg
17200  */
17201 
17202  /* function exit code */
17203  __pyx_L1_error:;
17204  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17205  __pyx_r = 0;
17206  __pyx_L0:;
17207  __Pyx_TraceReturn(Py_None, 1);
17208  return __pyx_r;
17209 }
17210 
17211 /* "View.MemoryView":1118
17212  *
17213  * @cname('__pyx_get_best_slice_order')
17214  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17215  * """
17216  * Figure out the best memory access order for a given slice.
17217  */
17218 
17219 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17220  int __pyx_v_i;
17221  Py_ssize_t __pyx_v_c_stride;
17222  Py_ssize_t __pyx_v_f_stride;
17223  char __pyx_r;
17224  __Pyx_TraceDeclarations
17225  int __pyx_t_1;
17226  int __pyx_t_2;
17227  int __pyx_t_3;
17228  int __pyx_t_4;
17229  int __pyx_lineno = 0;
17230  const char *__pyx_filename = NULL;
17231  int __pyx_clineno = 0;
17232  __Pyx_TraceCall("get_best_order", __pyx_f[2], 1118, 1, __PYX_ERR(2, 1118, __pyx_L1_error));
17233 
17234  /* "View.MemoryView":1123
17235  * """
17236  * cdef int i
17237  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
17238  * cdef Py_ssize_t f_stride = 0
17239  *
17240  */
17241  __Pyx_TraceLine(1123,1,__PYX_ERR(2, 1123, __pyx_L1_error))
17242  __pyx_v_c_stride = 0;
17243 
17244  /* "View.MemoryView":1124
17245  * cdef int i
17246  * cdef Py_ssize_t c_stride = 0
17247  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
17248  *
17249  * for i in range(ndim - 1, -1, -1):
17250  */
17251  __Pyx_TraceLine(1124,1,__PYX_ERR(2, 1124, __pyx_L1_error))
17252  __pyx_v_f_stride = 0;
17253 
17254  /* "View.MemoryView":1126
17255  * cdef Py_ssize_t f_stride = 0
17256  *
17257  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17258  * if mslice.shape[i] > 1:
17259  * c_stride = mslice.strides[i]
17260  */
17261  __Pyx_TraceLine(1126,1,__PYX_ERR(2, 1126, __pyx_L1_error))
17262  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17263  __pyx_v_i = __pyx_t_1;
17264 
17265  /* "View.MemoryView":1127
17266  *
17267  * for i in range(ndim - 1, -1, -1):
17268  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17269  * c_stride = mslice.strides[i]
17270  * break
17271  */
17272  __Pyx_TraceLine(1127,1,__PYX_ERR(2, 1127, __pyx_L1_error))
17273  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17274  if (__pyx_t_2) {
17275 
17276  /* "View.MemoryView":1128
17277  * for i in range(ndim - 1, -1, -1):
17278  * if mslice.shape[i] > 1:
17279  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17280  * break
17281  *
17282  */
17283  __Pyx_TraceLine(1128,1,__PYX_ERR(2, 1128, __pyx_L1_error))
17284  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17285 
17286  /* "View.MemoryView":1129
17287  * if mslice.shape[i] > 1:
17288  * c_stride = mslice.strides[i]
17289  * break # <<<<<<<<<<<<<<
17290  *
17291  * for i in range(ndim):
17292  */
17293  __Pyx_TraceLine(1129,1,__PYX_ERR(2, 1129, __pyx_L1_error))
17294  goto __pyx_L4_break;
17295 
17296  /* "View.MemoryView":1127
17297  *
17298  * for i in range(ndim - 1, -1, -1):
17299  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17300  * c_stride = mslice.strides[i]
17301  * break
17302  */
17303  }
17304  }
17305  __pyx_L4_break:;
17306 
17307  /* "View.MemoryView":1131
17308  * break
17309  *
17310  * for i in range(ndim): # <<<<<<<<<<<<<<
17311  * if mslice.shape[i] > 1:
17312  * f_stride = mslice.strides[i]
17313  */
17314  __Pyx_TraceLine(1131,1,__PYX_ERR(2, 1131, __pyx_L1_error))
17315  __pyx_t_1 = __pyx_v_ndim;
17316  __pyx_t_3 = __pyx_t_1;
17317  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17318  __pyx_v_i = __pyx_t_4;
17319 
17320  /* "View.MemoryView":1132
17321  *
17322  * for i in range(ndim):
17323  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17324  * f_stride = mslice.strides[i]
17325  * break
17326  */
17327  __Pyx_TraceLine(1132,1,__PYX_ERR(2, 1132, __pyx_L1_error))
17328  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17329  if (__pyx_t_2) {
17330 
17331  /* "View.MemoryView":1133
17332  * for i in range(ndim):
17333  * if mslice.shape[i] > 1:
17334  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17335  * break
17336  *
17337  */
17338  __Pyx_TraceLine(1133,1,__PYX_ERR(2, 1133, __pyx_L1_error))
17339  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17340 
17341  /* "View.MemoryView":1134
17342  * if mslice.shape[i] > 1:
17343  * f_stride = mslice.strides[i]
17344  * break # <<<<<<<<<<<<<<
17345  *
17346  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17347  */
17348  __Pyx_TraceLine(1134,1,__PYX_ERR(2, 1134, __pyx_L1_error))
17349  goto __pyx_L7_break;
17350 
17351  /* "View.MemoryView":1132
17352  *
17353  * for i in range(ndim):
17354  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17355  * f_stride = mslice.strides[i]
17356  * break
17357  */
17358  }
17359  }
17360  __pyx_L7_break:;
17361 
17362  /* "View.MemoryView":1136
17363  * break
17364  *
17365  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17366  * return 'C'
17367  * else:
17368  */
17369  __Pyx_TraceLine(1136,1,__PYX_ERR(2, 1136, __pyx_L1_error))
17370  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17371  if (__pyx_t_2) {
17372 
17373  /* "View.MemoryView":1137
17374  *
17375  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17376  * return 'C' # <<<<<<<<<<<<<<
17377  * else:
17378  * return 'F'
17379  */
17380  __Pyx_TraceLine(1137,1,__PYX_ERR(2, 1137, __pyx_L1_error))
17381  __pyx_r = 'C';
17382  goto __pyx_L0;
17383 
17384  /* "View.MemoryView":1136
17385  * break
17386  *
17387  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17388  * return 'C'
17389  * else:
17390  */
17391  }
17392 
17393  /* "View.MemoryView":1139
17394  * return 'C'
17395  * else:
17396  * return 'F' # <<<<<<<<<<<<<<
17397  *
17398  * @cython.cdivision(True)
17399  */
17400  __Pyx_TraceLine(1139,1,__PYX_ERR(2, 1139, __pyx_L1_error))
17401  /*else*/ {
17402  __pyx_r = 'F';
17403  goto __pyx_L0;
17404  }
17405 
17406  /* "View.MemoryView":1118
17407  *
17408  * @cname('__pyx_get_best_slice_order')
17409  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17410  * """
17411  * Figure out the best memory access order for a given slice.
17412  */
17413 
17414  /* function exit code */
17415  __pyx_L1_error:;
17416  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17417  __pyx_r = 0;
17418  __pyx_L0:;
17419  __Pyx_TraceReturn(Py_None, 1);
17420  return __pyx_r;
17421 }
17422 
17423 /* "View.MemoryView":1142
17424  *
17425  * @cython.cdivision(True)
17426  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17427  * char *dst_data, Py_ssize_t *dst_strides,
17428  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17429  */
17430 
17431 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17432  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17433  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
17434  Py_ssize_t __pyx_v_dst_extent;
17435  Py_ssize_t __pyx_v_src_stride;
17436  Py_ssize_t __pyx_v_dst_stride;
17437  int __pyx_t_1;
17438  int __pyx_t_2;
17439  int __pyx_t_3;
17440  Py_ssize_t __pyx_t_4;
17441  Py_ssize_t __pyx_t_5;
17442  Py_ssize_t __pyx_t_6;
17443 
17444  /* "View.MemoryView":1149
17445  *
17446  * cdef Py_ssize_t i
17447  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
17448  * cdef Py_ssize_t dst_extent = dst_shape[0]
17449  * cdef Py_ssize_t src_stride = src_strides[0]
17450  */
17451  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17452 
17453  /* "View.MemoryView":1150
17454  * cdef Py_ssize_t i
17455  * cdef Py_ssize_t src_extent = src_shape[0]
17456  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
17457  * cdef Py_ssize_t src_stride = src_strides[0]
17458  * cdef Py_ssize_t dst_stride = dst_strides[0]
17459  */
17460  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17461 
17462  /* "View.MemoryView":1151
17463  * cdef Py_ssize_t src_extent = src_shape[0]
17464  * cdef Py_ssize_t dst_extent = dst_shape[0]
17465  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
17466  * cdef Py_ssize_t dst_stride = dst_strides[0]
17467  *
17468  */
17469  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17470 
17471  /* "View.MemoryView":1152
17472  * cdef Py_ssize_t dst_extent = dst_shape[0]
17473  * cdef Py_ssize_t src_stride = src_strides[0]
17474  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
17475  *
17476  * if ndim == 1:
17477  */
17478  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17479 
17480  /* "View.MemoryView":1154
17481  * cdef Py_ssize_t dst_stride = dst_strides[0]
17482  *
17483  * if ndim == 1: # <<<<<<<<<<<<<<
17484  * if (src_stride > 0 and dst_stride > 0 and
17485  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17486  */
17487  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17488  if (__pyx_t_1) {
17489 
17490  /* "View.MemoryView":1155
17491  *
17492  * if ndim == 1:
17493  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17494  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17495  * memcpy(dst_data, src_data, itemsize * dst_extent)
17496  */
17497  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
17498  if (__pyx_t_2) {
17499  } else {
17500  __pyx_t_1 = __pyx_t_2;
17501  goto __pyx_L5_bool_binop_done;
17502  }
17503  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
17504  if (__pyx_t_2) {
17505  } else {
17506  __pyx_t_1 = __pyx_t_2;
17507  goto __pyx_L5_bool_binop_done;
17508  }
17509 
17510  /* "View.MemoryView":1156
17511  * if ndim == 1:
17512  * if (src_stride > 0 and dst_stride > 0 and
17513  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
17514  * memcpy(dst_data, src_data, itemsize * dst_extent)
17515  * else:
17516  */
17517  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17518  if (__pyx_t_2) {
17519  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17520  }
17521  __pyx_t_3 = (__pyx_t_2 != 0);
17522  __pyx_t_1 = __pyx_t_3;
17523  __pyx_L5_bool_binop_done:;
17524 
17525  /* "View.MemoryView":1155
17526  *
17527  * if ndim == 1:
17528  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17529  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17530  * memcpy(dst_data, src_data, itemsize * dst_extent)
17531  */
17532  if (__pyx_t_1) {
17533 
17534  /* "View.MemoryView":1157
17535  * if (src_stride > 0 and dst_stride > 0 and
17536  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17537  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
17538  * else:
17539  * for i in range(dst_extent):
17540  */
17541  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17542 
17543  /* "View.MemoryView":1155
17544  *
17545  * if ndim == 1:
17546  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17547  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17548  * memcpy(dst_data, src_data, itemsize * dst_extent)
17549  */
17550  goto __pyx_L4;
17551  }
17552 
17553  /* "View.MemoryView":1159
17554  * memcpy(dst_data, src_data, itemsize * dst_extent)
17555  * else:
17556  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17557  * memcpy(dst_data, src_data, itemsize)
17558  * src_data += src_stride
17559  */
17560  /*else*/ {
17561  __pyx_t_4 = __pyx_v_dst_extent;
17562  __pyx_t_5 = __pyx_t_4;
17563  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17564  __pyx_v_i = __pyx_t_6;
17565 
17566  /* "View.MemoryView":1160
17567  * else:
17568  * for i in range(dst_extent):
17569  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
17570  * src_data += src_stride
17571  * dst_data += dst_stride
17572  */
17573  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17574 
17575  /* "View.MemoryView":1161
17576  * for i in range(dst_extent):
17577  * memcpy(dst_data, src_data, itemsize)
17578  * src_data += src_stride # <<<<<<<<<<<<<<
17579  * dst_data += dst_stride
17580  * else:
17581  */
17582  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17583 
17584  /* "View.MemoryView":1162
17585  * memcpy(dst_data, src_data, itemsize)
17586  * src_data += src_stride
17587  * dst_data += dst_stride # <<<<<<<<<<<<<<
17588  * else:
17589  * for i in range(dst_extent):
17590  */
17591  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17592  }
17593  }
17594  __pyx_L4:;
17595 
17596  /* "View.MemoryView":1154
17597  * cdef Py_ssize_t dst_stride = dst_strides[0]
17598  *
17599  * if ndim == 1: # <<<<<<<<<<<<<<
17600  * if (src_stride > 0 and dst_stride > 0 and
17601  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17602  */
17603  goto __pyx_L3;
17604  }
17605 
17606  /* "View.MemoryView":1164
17607  * dst_data += dst_stride
17608  * else:
17609  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17610  * _copy_strided_to_strided(src_data, src_strides + 1,
17611  * dst_data, dst_strides + 1,
17612  */
17613  /*else*/ {
17614  __pyx_t_4 = __pyx_v_dst_extent;
17615  __pyx_t_5 = __pyx_t_4;
17616  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17617  __pyx_v_i = __pyx_t_6;
17618 
17619  /* "View.MemoryView":1165
17620  * else:
17621  * for i in range(dst_extent):
17622  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
17623  * dst_data, dst_strides + 1,
17624  * src_shape + 1, dst_shape + 1,
17625  */
17626  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17627 
17628  /* "View.MemoryView":1169
17629  * src_shape + 1, dst_shape + 1,
17630  * ndim - 1, itemsize)
17631  * src_data += src_stride # <<<<<<<<<<<<<<
17632  * dst_data += dst_stride
17633  *
17634  */
17635  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17636 
17637  /* "View.MemoryView":1170
17638  * ndim - 1, itemsize)
17639  * src_data += src_stride
17640  * dst_data += dst_stride # <<<<<<<<<<<<<<
17641  *
17642  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
17643  */
17644  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17645  }
17646  }
17647  __pyx_L3:;
17648 
17649  /* "View.MemoryView":1142
17650  *
17651  * @cython.cdivision(True)
17652  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17653  * char *dst_data, Py_ssize_t *dst_strides,
17654  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17655  */
17656 
17657  /* function exit code */
17658 }
17659 
17660 /* "View.MemoryView":1172
17661  * dst_data += dst_stride
17662  *
17663  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17664  * __Pyx_memviewslice *dst,
17665  * int ndim, size_t itemsize) nogil:
17666  */
17667 
17668 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17669  __Pyx_TraceDeclarations
17670  int __pyx_lineno = 0;
17671  const char *__pyx_filename = NULL;
17672  int __pyx_clineno = 0;
17673  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[2], 1172, 1, __PYX_ERR(2, 1172, __pyx_L1_error));
17674 
17675  /* "View.MemoryView":1175
17676  * __Pyx_memviewslice *dst,
17677  * int ndim, size_t itemsize) nogil:
17678  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
17679  * src.shape, dst.shape, ndim, itemsize)
17680  *
17681  */
17682  __Pyx_TraceLine(1175,1,__PYX_ERR(2, 1175, __pyx_L1_error))
17683  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17684 
17685  /* "View.MemoryView":1172
17686  * dst_data += dst_stride
17687  *
17688  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17689  * __Pyx_memviewslice *dst,
17690  * int ndim, size_t itemsize) nogil:
17691  */
17692 
17693  /* function exit code */
17694  goto __pyx_L0;
17695  __pyx_L1_error:;
17696  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17697  __pyx_L0:;
17698  __Pyx_TraceReturn(Py_None, 1);
17699 }
17700 
17701 /* "View.MemoryView":1179
17702  *
17703  * @cname('__pyx_memoryview_slice_get_size')
17704  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17705  * "Return the size of the memory occupied by the slice in number of bytes"
17706  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17707  */
17708 
17709 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
17710  Py_ssize_t __pyx_v_shape;
17711  Py_ssize_t __pyx_v_size;
17712  Py_ssize_t __pyx_r;
17713  __Pyx_TraceDeclarations
17714  Py_ssize_t __pyx_t_1;
17715  Py_ssize_t *__pyx_t_2;
17716  Py_ssize_t *__pyx_t_3;
17717  Py_ssize_t *__pyx_t_4;
17718  int __pyx_lineno = 0;
17719  const char *__pyx_filename = NULL;
17720  int __pyx_clineno = 0;
17721  __Pyx_TraceCall("slice_get_size", __pyx_f[2], 1179, 1, __PYX_ERR(2, 1179, __pyx_L1_error));
17722 
17723  /* "View.MemoryView":1181
17724  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
17725  * "Return the size of the memory occupied by the slice in number of bytes"
17726  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
17727  *
17728  * for shape in src.shape[:ndim]:
17729  */
17730  __Pyx_TraceLine(1181,1,__PYX_ERR(2, 1181, __pyx_L1_error))
17731  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17732  __pyx_v_size = __pyx_t_1;
17733 
17734  /* "View.MemoryView":1183
17735  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17736  *
17737  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
17738  * size *= shape
17739  *
17740  */
17741  __Pyx_TraceLine(1183,1,__PYX_ERR(2, 1183, __pyx_L1_error))
17742  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17743  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17744  __pyx_t_2 = __pyx_t_4;
17745  __pyx_v_shape = (__pyx_t_2[0]);
17746 
17747  /* "View.MemoryView":1184
17748  *
17749  * for shape in src.shape[:ndim]:
17750  * size *= shape # <<<<<<<<<<<<<<
17751  *
17752  * return size
17753  */
17754  __Pyx_TraceLine(1184,1,__PYX_ERR(2, 1184, __pyx_L1_error))
17755  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17756  }
17757 
17758  /* "View.MemoryView":1186
17759  * size *= shape
17760  *
17761  * return size # <<<<<<<<<<<<<<
17762  *
17763  * @cname('__pyx_fill_contig_strides_array')
17764  */
17765  __Pyx_TraceLine(1186,1,__PYX_ERR(2, 1186, __pyx_L1_error))
17766  __pyx_r = __pyx_v_size;
17767  goto __pyx_L0;
17768 
17769  /* "View.MemoryView":1179
17770  *
17771  * @cname('__pyx_memoryview_slice_get_size')
17772  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17773  * "Return the size of the memory occupied by the slice in number of bytes"
17774  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17775  */
17776 
17777  /* function exit code */
17778  __pyx_L1_error:;
17779  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17780  __pyx_r = 0;
17781  __pyx_L0:;
17782  __Pyx_TraceReturn(Py_None, 1);
17783  return __pyx_r;
17784 }
17785 
17786 /* "View.MemoryView":1189
17787  *
17788  * @cname('__pyx_fill_contig_strides_array')
17789  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17790  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17791  * int ndim, char order) nogil:
17792  */
17793 
17794 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
17795  int __pyx_v_idx;
17796  Py_ssize_t __pyx_r;
17797  __Pyx_TraceDeclarations
17798  int __pyx_t_1;
17799  int __pyx_t_2;
17800  int __pyx_t_3;
17801  int __pyx_t_4;
17802  int __pyx_lineno = 0;
17803  const char *__pyx_filename = NULL;
17804  int __pyx_clineno = 0;
17805  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[2], 1189, 1, __PYX_ERR(2, 1189, __pyx_L1_error));
17806 
17807  /* "View.MemoryView":1198
17808  * cdef int idx
17809  *
17810  * if order == 'F': # <<<<<<<<<<<<<<
17811  * for idx in range(ndim):
17812  * strides[idx] = stride
17813  */
17814  __Pyx_TraceLine(1198,1,__PYX_ERR(2, 1198, __pyx_L1_error))
17815  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
17816  if (__pyx_t_1) {
17817 
17818  /* "View.MemoryView":1199
17819  *
17820  * if order == 'F':
17821  * for idx in range(ndim): # <<<<<<<<<<<<<<
17822  * strides[idx] = stride
17823  * stride *= shape[idx]
17824  */
17825  __Pyx_TraceLine(1199,1,__PYX_ERR(2, 1199, __pyx_L1_error))
17826  __pyx_t_2 = __pyx_v_ndim;
17827  __pyx_t_3 = __pyx_t_2;
17828  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17829  __pyx_v_idx = __pyx_t_4;
17830 
17831  /* "View.MemoryView":1200
17832  * if order == 'F':
17833  * for idx in range(ndim):
17834  * strides[idx] = stride # <<<<<<<<<<<<<<
17835  * stride *= shape[idx]
17836  * else:
17837  */
17838  __Pyx_TraceLine(1200,1,__PYX_ERR(2, 1200, __pyx_L1_error))
17839  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17840 
17841  /* "View.MemoryView":1201
17842  * for idx in range(ndim):
17843  * strides[idx] = stride
17844  * stride *= shape[idx] # <<<<<<<<<<<<<<
17845  * else:
17846  * for idx in range(ndim - 1, -1, -1):
17847  */
17848  __Pyx_TraceLine(1201,1,__PYX_ERR(2, 1201, __pyx_L1_error))
17849  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17850  }
17851 
17852  /* "View.MemoryView":1198
17853  * cdef int idx
17854  *
17855  * if order == 'F': # <<<<<<<<<<<<<<
17856  * for idx in range(ndim):
17857  * strides[idx] = stride
17858  */
17859  goto __pyx_L3;
17860  }
17861 
17862  /* "View.MemoryView":1203
17863  * stride *= shape[idx]
17864  * else:
17865  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17866  * strides[idx] = stride
17867  * stride *= shape[idx]
17868  */
17869  __Pyx_TraceLine(1203,1,__PYX_ERR(2, 1203, __pyx_L1_error))
17870  /*else*/ {
17871  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17872  __pyx_v_idx = __pyx_t_2;
17873 
17874  /* "View.MemoryView":1204
17875  * else:
17876  * for idx in range(ndim - 1, -1, -1):
17877  * strides[idx] = stride # <<<<<<<<<<<<<<
17878  * stride *= shape[idx]
17879  *
17880  */
17881  __Pyx_TraceLine(1204,1,__PYX_ERR(2, 1204, __pyx_L1_error))
17882  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17883 
17884  /* "View.MemoryView":1205
17885  * for idx in range(ndim - 1, -1, -1):
17886  * strides[idx] = stride
17887  * stride *= shape[idx] # <<<<<<<<<<<<<<
17888  *
17889  * return stride
17890  */
17891  __Pyx_TraceLine(1205,1,__PYX_ERR(2, 1205, __pyx_L1_error))
17892  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17893  }
17894  }
17895  __pyx_L3:;
17896 
17897  /* "View.MemoryView":1207
17898  * stride *= shape[idx]
17899  *
17900  * return stride # <<<<<<<<<<<<<<
17901  *
17902  * @cname('__pyx_memoryview_copy_data_to_temp')
17903  */
17904  __Pyx_TraceLine(1207,1,__PYX_ERR(2, 1207, __pyx_L1_error))
17905  __pyx_r = __pyx_v_stride;
17906  goto __pyx_L0;
17907 
17908  /* "View.MemoryView":1189
17909  *
17910  * @cname('__pyx_fill_contig_strides_array')
17911  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17912  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17913  * int ndim, char order) nogil:
17914  */
17915 
17916  /* function exit code */
17917  __pyx_L1_error:;
17918  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17919  __pyx_r = 0;
17920  __pyx_L0:;
17921  __Pyx_TraceReturn(Py_None, 1);
17922  return __pyx_r;
17923 }
17924 
17925 /* "View.MemoryView":1210
17926  *
17927  * @cname('__pyx_memoryview_copy_data_to_temp')
17928  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17929  * __Pyx_memviewslice *tmpslice,
17930  * char order,
17931  */
17932 
17933 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
17934  int __pyx_v_i;
17935  void *__pyx_v_result;
17936  size_t __pyx_v_itemsize;
17937  size_t __pyx_v_size;
17938  void *__pyx_r;
17939  __Pyx_TraceDeclarations
17940  Py_ssize_t __pyx_t_1;
17941  int __pyx_t_2;
17942  int __pyx_t_3;
17943  struct __pyx_memoryview_obj *__pyx_t_4;
17944  int __pyx_t_5;
17945  int __pyx_t_6;
17946  int __pyx_lineno = 0;
17947  const char *__pyx_filename = NULL;
17948  int __pyx_clineno = 0;
17949  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[2], 1210, 1, __PYX_ERR(2, 1210, __pyx_L1_error));
17950 
17951  /* "View.MemoryView":1221
17952  * cdef void *result
17953  *
17954  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17955  * cdef size_t size = slice_get_size(src, ndim)
17956  *
17957  */
17958  __Pyx_TraceLine(1221,1,__PYX_ERR(2, 1221, __pyx_L1_error))
17959  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17960  __pyx_v_itemsize = __pyx_t_1;
17961 
17962  /* "View.MemoryView":1222
17963  *
17964  * cdef size_t itemsize = src.memview.view.itemsize
17965  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
17966  *
17967  * result = malloc(size)
17968  */
17969  __Pyx_TraceLine(1222,1,__PYX_ERR(2, 1222, __pyx_L1_error))
17970  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17971 
17972  /* "View.MemoryView":1224
17973  * cdef size_t size = slice_get_size(src, ndim)
17974  *
17975  * result = malloc(size) # <<<<<<<<<<<<<<
17976  * if not result:
17977  * _err(MemoryError, NULL)
17978  */
17979  __Pyx_TraceLine(1224,1,__PYX_ERR(2, 1224, __pyx_L1_error))
17980  __pyx_v_result = malloc(__pyx_v_size);
17981 
17982  /* "View.MemoryView":1225
17983  *
17984  * result = malloc(size)
17985  * if not result: # <<<<<<<<<<<<<<
17986  * _err(MemoryError, NULL)
17987  *
17988  */
17989  __Pyx_TraceLine(1225,1,__PYX_ERR(2, 1225, __pyx_L1_error))
17990  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
17991  if (__pyx_t_2) {
17992 
17993  /* "View.MemoryView":1226
17994  * result = malloc(size)
17995  * if not result:
17996  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
17997  *
17998  *
17999  */
18000  __Pyx_TraceLine(1226,1,__PYX_ERR(2, 1226, __pyx_L1_error))
18001  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1226, __pyx_L1_error)
18002 
18003  /* "View.MemoryView":1225
18004  *
18005  * result = malloc(size)
18006  * if not result: # <<<<<<<<<<<<<<
18007  * _err(MemoryError, NULL)
18008  *
18009  */
18010  }
18011 
18012  /* "View.MemoryView":1229
18013  *
18014  *
18015  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
18016  * tmpslice.memview = src.memview
18017  * for i in range(ndim):
18018  */
18019  __Pyx_TraceLine(1229,1,__PYX_ERR(2, 1229, __pyx_L1_error))
18020  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18021 
18022  /* "View.MemoryView":1230
18023  *
18024  * tmpslice.data = <char *> result
18025  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
18026  * for i in range(ndim):
18027  * tmpslice.shape[i] = src.shape[i]
18028  */
18029  __Pyx_TraceLine(1230,1,__PYX_ERR(2, 1230, __pyx_L1_error))
18030  __pyx_t_4 = __pyx_v_src->memview;
18031  __pyx_v_tmpslice->memview = __pyx_t_4;
18032 
18033  /* "View.MemoryView":1231
18034  * tmpslice.data = <char *> result
18035  * tmpslice.memview = src.memview
18036  * for i in range(ndim): # <<<<<<<<<<<<<<
18037  * tmpslice.shape[i] = src.shape[i]
18038  * tmpslice.suboffsets[i] = -1
18039  */
18040  __Pyx_TraceLine(1231,1,__PYX_ERR(2, 1231, __pyx_L1_error))
18041  __pyx_t_3 = __pyx_v_ndim;
18042  __pyx_t_5 = __pyx_t_3;
18043  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18044  __pyx_v_i = __pyx_t_6;
18045 
18046  /* "View.MemoryView":1232
18047  * tmpslice.memview = src.memview
18048  * for i in range(ndim):
18049  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18050  * tmpslice.suboffsets[i] = -1
18051  *
18052  */
18053  __Pyx_TraceLine(1232,1,__PYX_ERR(2, 1232, __pyx_L1_error))
18054  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18055 
18056  /* "View.MemoryView":1233
18057  * for i in range(ndim):
18058  * tmpslice.shape[i] = src.shape[i]
18059  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18060  *
18061  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18062  */
18063  __Pyx_TraceLine(1233,1,__PYX_ERR(2, 1233, __pyx_L1_error))
18064  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18065  }
18066 
18067  /* "View.MemoryView":1235
18068  * tmpslice.suboffsets[i] = -1
18069  *
18070  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18071  * ndim, order)
18072  *
18073  */
18074  __Pyx_TraceLine(1235,1,__PYX_ERR(2, 1235, __pyx_L1_error))
18075  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18076 
18077  /* "View.MemoryView":1239
18078  *
18079  *
18080  * for i in range(ndim): # <<<<<<<<<<<<<<
18081  * if tmpslice.shape[i] == 1:
18082  * tmpslice.strides[i] = 0
18083  */
18084  __Pyx_TraceLine(1239,1,__PYX_ERR(2, 1239, __pyx_L1_error))
18085  __pyx_t_3 = __pyx_v_ndim;
18086  __pyx_t_5 = __pyx_t_3;
18087  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18088  __pyx_v_i = __pyx_t_6;
18089 
18090  /* "View.MemoryView":1240
18091  *
18092  * for i in range(ndim):
18093  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18094  * tmpslice.strides[i] = 0
18095  *
18096  */
18097  __Pyx_TraceLine(1240,1,__PYX_ERR(2, 1240, __pyx_L1_error))
18098  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18099  if (__pyx_t_2) {
18100 
18101  /* "View.MemoryView":1241
18102  * for i in range(ndim):
18103  * if tmpslice.shape[i] == 1:
18104  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
18105  *
18106  * if slice_is_contig(src[0], order, ndim):
18107  */
18108  __Pyx_TraceLine(1241,1,__PYX_ERR(2, 1241, __pyx_L1_error))
18109  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18110 
18111  /* "View.MemoryView":1240
18112  *
18113  * for i in range(ndim):
18114  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18115  * tmpslice.strides[i] = 0
18116  *
18117  */
18118  }
18119  }
18120 
18121  /* "View.MemoryView":1243
18122  * tmpslice.strides[i] = 0
18123  *
18124  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18125  * memcpy(result, src.data, size)
18126  * else:
18127  */
18128  __Pyx_TraceLine(1243,1,__PYX_ERR(2, 1243, __pyx_L1_error))
18129  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18130  if (__pyx_t_2) {
18131 
18132  /* "View.MemoryView":1244
18133  *
18134  * if slice_is_contig(src[0], order, ndim):
18135  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
18136  * else:
18137  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18138  */
18139  __Pyx_TraceLine(1244,1,__PYX_ERR(2, 1244, __pyx_L1_error))
18140  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18141 
18142  /* "View.MemoryView":1243
18143  * tmpslice.strides[i] = 0
18144  *
18145  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18146  * memcpy(result, src.data, size)
18147  * else:
18148  */
18149  goto __pyx_L9;
18150  }
18151 
18152  /* "View.MemoryView":1246
18153  * memcpy(result, src.data, size)
18154  * else:
18155  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18156  *
18157  * return result
18158  */
18159  __Pyx_TraceLine(1246,1,__PYX_ERR(2, 1246, __pyx_L1_error))
18160  /*else*/ {
18161  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18162  }
18163  __pyx_L9:;
18164 
18165  /* "View.MemoryView":1248
18166  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18167  *
18168  * return result # <<<<<<<<<<<<<<
18169  *
18170  *
18171  */
18172  __Pyx_TraceLine(1248,1,__PYX_ERR(2, 1248, __pyx_L1_error))
18173  __pyx_r = __pyx_v_result;
18174  goto __pyx_L0;
18175 
18176  /* "View.MemoryView":1210
18177  *
18178  * @cname('__pyx_memoryview_copy_data_to_temp')
18179  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18180  * __Pyx_memviewslice *tmpslice,
18181  * char order,
18182  */
18183 
18184  /* function exit code */
18185  __pyx_L1_error:;
18186  {
18187  #ifdef WITH_THREAD
18188  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18189  #endif
18190  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18191  #ifdef WITH_THREAD
18192  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18193  #endif
18194  }
18195  __pyx_r = NULL;
18196  __pyx_L0:;
18197  __Pyx_TraceReturn(Py_None, 1);
18198  return __pyx_r;
18199 }
18200 
18201 /* "View.MemoryView":1253
18202  *
18203  * @cname('__pyx_memoryview_err_extents')
18204  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18205  * Py_ssize_t extent2) except -1 with gil:
18206  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18207  */
18208 
18209 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18210  int __pyx_r;
18211  __Pyx_TraceDeclarations
18212  __Pyx_RefNannyDeclarations
18213  PyObject *__pyx_t_1 = NULL;
18214  PyObject *__pyx_t_2 = NULL;
18215  PyObject *__pyx_t_3 = NULL;
18216  PyObject *__pyx_t_4 = NULL;
18217  int __pyx_lineno = 0;
18218  const char *__pyx_filename = NULL;
18219  int __pyx_clineno = 0;
18220  #ifdef WITH_THREAD
18221  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18222  #endif
18223  __Pyx_RefNannySetupContext("_err_extents", 0);
18224  __Pyx_TraceCall("_err_extents", __pyx_f[2], 1253, 0, __PYX_ERR(2, 1253, __pyx_L1_error));
18225 
18226  /* "View.MemoryView":1256
18227  * Py_ssize_t extent2) except -1 with gil:
18228  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18229  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
18230  *
18231  * @cname('__pyx_memoryview_err_dim')
18232  */
18233  __Pyx_TraceLine(1256,0,__PYX_ERR(2, 1256, __pyx_L1_error))
18234  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1256, __pyx_L1_error)
18235  __Pyx_GOTREF(__pyx_t_1);
18236  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1256, __pyx_L1_error)
18237  __Pyx_GOTREF(__pyx_t_2);
18238  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1256, __pyx_L1_error)
18239  __Pyx_GOTREF(__pyx_t_3);
18240  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1256, __pyx_L1_error)
18241  __Pyx_GOTREF(__pyx_t_4);
18242  __Pyx_GIVEREF(__pyx_t_1);
18243  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18244  __Pyx_GIVEREF(__pyx_t_2);
18245  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18246  __Pyx_GIVEREF(__pyx_t_3);
18247  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18248  __pyx_t_1 = 0;
18249  __pyx_t_2 = 0;
18250  __pyx_t_3 = 0;
18251 
18252  /* "View.MemoryView":1255
18253  * cdef int _err_extents(int i, Py_ssize_t extent1,
18254  * Py_ssize_t extent2) except -1 with gil:
18255  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
18256  * (i, extent1, extent2))
18257  *
18258  */
18259  __Pyx_TraceLine(1255,0,__PYX_ERR(2, 1255, __pyx_L1_error))
18260  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error)
18261  __Pyx_GOTREF(__pyx_t_3);
18262  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18263  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error)
18264  __Pyx_GOTREF(__pyx_t_4);
18265  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18266  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18267  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18268  __PYX_ERR(2, 1255, __pyx_L1_error)
18269 
18270  /* "View.MemoryView":1253
18271  *
18272  * @cname('__pyx_memoryview_err_extents')
18273  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18274  * Py_ssize_t extent2) except -1 with gil:
18275  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18276  */
18277 
18278  /* function exit code */
18279  __pyx_L1_error:;
18280  __Pyx_XDECREF(__pyx_t_1);
18281  __Pyx_XDECREF(__pyx_t_2);
18282  __Pyx_XDECREF(__pyx_t_3);
18283  __Pyx_XDECREF(__pyx_t_4);
18284  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18285  __pyx_r = -1;
18286  __Pyx_TraceReturn(Py_None, 0);
18287  __Pyx_RefNannyFinishContext();
18288  #ifdef WITH_THREAD
18289  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18290  #endif
18291  return __pyx_r;
18292 }
18293 
18294 /* "View.MemoryView":1259
18295  *
18296  * @cname('__pyx_memoryview_err_dim')
18297  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18298  * raise error(msg.decode('ascii') % dim)
18299  *
18300  */
18301 
18302 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
18303  int __pyx_r;
18304  __Pyx_TraceDeclarations
18305  __Pyx_RefNannyDeclarations
18306  PyObject *__pyx_t_1 = NULL;
18307  PyObject *__pyx_t_2 = NULL;
18308  PyObject *__pyx_t_3 = NULL;
18309  PyObject *__pyx_t_4 = NULL;
18310  int __pyx_lineno = 0;
18311  const char *__pyx_filename = NULL;
18312  int __pyx_clineno = 0;
18313  #ifdef WITH_THREAD
18314  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18315  #endif
18316  __Pyx_RefNannySetupContext("_err_dim", 0);
18317  __Pyx_TraceCall("_err_dim", __pyx_f[2], 1259, 0, __PYX_ERR(2, 1259, __pyx_L1_error));
18318  __Pyx_INCREF(__pyx_v_error);
18319 
18320  /* "View.MemoryView":1260
18321  * @cname('__pyx_memoryview_err_dim')
18322  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
18323  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
18324  *
18325  * @cname('__pyx_memoryview_err')
18326  */
18327  __Pyx_TraceLine(1260,0,__PYX_ERR(2, 1260, __pyx_L1_error))
18328  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error)
18329  __Pyx_GOTREF(__pyx_t_2);
18330  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error)
18331  __Pyx_GOTREF(__pyx_t_3);
18332  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1260, __pyx_L1_error)
18333  __Pyx_GOTREF(__pyx_t_4);
18334  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18335  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18336  __Pyx_INCREF(__pyx_v_error);
18337  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18338  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18339  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18340  if (likely(__pyx_t_2)) {
18341  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18342  __Pyx_INCREF(__pyx_t_2);
18343  __Pyx_INCREF(function);
18344  __Pyx_DECREF_SET(__pyx_t_3, function);
18345  }
18346  }
18347  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
18348  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18349  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18350  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1260, __pyx_L1_error)
18351  __Pyx_GOTREF(__pyx_t_1);
18352  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18353  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18354  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18355  __PYX_ERR(2, 1260, __pyx_L1_error)
18356 
18357  /* "View.MemoryView":1259
18358  *
18359  * @cname('__pyx_memoryview_err_dim')
18360  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18361  * raise error(msg.decode('ascii') % dim)
18362  *
18363  */
18364 
18365  /* function exit code */
18366  __pyx_L1_error:;
18367  __Pyx_XDECREF(__pyx_t_1);
18368  __Pyx_XDECREF(__pyx_t_2);
18369  __Pyx_XDECREF(__pyx_t_3);
18370  __Pyx_XDECREF(__pyx_t_4);
18371  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18372  __pyx_r = -1;
18373  __Pyx_XDECREF(__pyx_v_error);
18374  __Pyx_TraceReturn(Py_None, 0);
18375  __Pyx_RefNannyFinishContext();
18376  #ifdef WITH_THREAD
18377  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18378  #endif
18379  return __pyx_r;
18380 }
18381 
18382 /* "View.MemoryView":1263
18383  *
18384  * @cname('__pyx_memoryview_err')
18385  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18386  * if msg != NULL:
18387  * raise error(msg.decode('ascii'))
18388  */
18389 
18390 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
18391  int __pyx_r;
18392  __Pyx_TraceDeclarations
18393  __Pyx_RefNannyDeclarations
18394  int __pyx_t_1;
18395  PyObject *__pyx_t_2 = NULL;
18396  PyObject *__pyx_t_3 = NULL;
18397  PyObject *__pyx_t_4 = NULL;
18398  PyObject *__pyx_t_5 = NULL;
18399  int __pyx_lineno = 0;
18400  const char *__pyx_filename = NULL;
18401  int __pyx_clineno = 0;
18402  #ifdef WITH_THREAD
18403  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18404  #endif
18405  __Pyx_RefNannySetupContext("_err", 0);
18406  __Pyx_TraceCall("_err", __pyx_f[2], 1263, 0, __PYX_ERR(2, 1263, __pyx_L1_error));
18407  __Pyx_INCREF(__pyx_v_error);
18408 
18409  /* "View.MemoryView":1264
18410  * @cname('__pyx_memoryview_err')
18411  * cdef int _err(object error, char *msg) except -1 with gil:
18412  * if msg != NULL: # <<<<<<<<<<<<<<
18413  * raise error(msg.decode('ascii'))
18414  * else:
18415  */
18416  __Pyx_TraceLine(1264,0,__PYX_ERR(2, 1264, __pyx_L1_error))
18417  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18418  if (unlikely(__pyx_t_1)) {
18419 
18420  /* "View.MemoryView":1265
18421  * cdef int _err(object error, char *msg) except -1 with gil:
18422  * if msg != NULL:
18423  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
18424  * else:
18425  * raise error
18426  */
18427  __Pyx_TraceLine(1265,0,__PYX_ERR(2, 1265, __pyx_L1_error))
18428  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1265, __pyx_L1_error)
18429  __Pyx_GOTREF(__pyx_t_3);
18430  __Pyx_INCREF(__pyx_v_error);
18431  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
18432  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18433  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18434  if (likely(__pyx_t_5)) {
18435  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18436  __Pyx_INCREF(__pyx_t_5);
18437  __Pyx_INCREF(function);
18438  __Pyx_DECREF_SET(__pyx_t_4, function);
18439  }
18440  }
18441  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
18442  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18443  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18444  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1265, __pyx_L1_error)
18445  __Pyx_GOTREF(__pyx_t_2);
18446  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18447  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18448  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18449  __PYX_ERR(2, 1265, __pyx_L1_error)
18450 
18451  /* "View.MemoryView":1264
18452  * @cname('__pyx_memoryview_err')
18453  * cdef int _err(object error, char *msg) except -1 with gil:
18454  * if msg != NULL: # <<<<<<<<<<<<<<
18455  * raise error(msg.decode('ascii'))
18456  * else:
18457  */
18458  }
18459 
18460  /* "View.MemoryView":1267
18461  * raise error(msg.decode('ascii'))
18462  * else:
18463  * raise error # <<<<<<<<<<<<<<
18464  *
18465  * @cname('__pyx_memoryview_copy_contents')
18466  */
18467  __Pyx_TraceLine(1267,0,__PYX_ERR(2, 1267, __pyx_L1_error))
18468  /*else*/ {
18469  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18470  __PYX_ERR(2, 1267, __pyx_L1_error)
18471  }
18472 
18473  /* "View.MemoryView":1263
18474  *
18475  * @cname('__pyx_memoryview_err')
18476  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18477  * if msg != NULL:
18478  * raise error(msg.decode('ascii'))
18479  */
18480 
18481  /* function exit code */
18482  __pyx_L1_error:;
18483  __Pyx_XDECREF(__pyx_t_2);
18484  __Pyx_XDECREF(__pyx_t_3);
18485  __Pyx_XDECREF(__pyx_t_4);
18486  __Pyx_XDECREF(__pyx_t_5);
18487  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
18488  __pyx_r = -1;
18489  __Pyx_XDECREF(__pyx_v_error);
18490  __Pyx_TraceReturn(Py_None, 0);
18491  __Pyx_RefNannyFinishContext();
18492  #ifdef WITH_THREAD
18493  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18494  #endif
18495  return __pyx_r;
18496 }
18497 
18498 /* "View.MemoryView":1270
18499  *
18500  * @cname('__pyx_memoryview_copy_contents')
18501  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18502  * __Pyx_memviewslice dst,
18503  * int src_ndim, int dst_ndim,
18504  */
18505 
18506 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
18507  void *__pyx_v_tmpdata;
18508  size_t __pyx_v_itemsize;
18509  int __pyx_v_i;
18510  char __pyx_v_order;
18511  int __pyx_v_broadcasting;
18512  int __pyx_v_direct_copy;
18513  __Pyx_memviewslice __pyx_v_tmp;
18514  int __pyx_v_ndim;
18515  int __pyx_r;
18516  __Pyx_TraceDeclarations
18517  Py_ssize_t __pyx_t_1;
18518  int __pyx_t_2;
18519  int __pyx_t_3;
18520  int __pyx_t_4;
18521  int __pyx_t_5;
18522  int __pyx_t_6;
18523  void *__pyx_t_7;
18524  int __pyx_t_8;
18525  int __pyx_lineno = 0;
18526  const char *__pyx_filename = NULL;
18527  int __pyx_clineno = 0;
18528  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[2], 1270, 1, __PYX_ERR(2, 1270, __pyx_L1_error));
18529 
18530  /* "View.MemoryView":1278
18531  * Check for overlapping memory and verify the shapes.
18532  * """
18533  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
18534  * cdef size_t itemsize = src.memview.view.itemsize
18535  * cdef int i
18536  */
18537  __Pyx_TraceLine(1278,1,__PYX_ERR(2, 1278, __pyx_L1_error))
18538  __pyx_v_tmpdata = NULL;
18539 
18540  /* "View.MemoryView":1279
18541  * """
18542  * cdef void *tmpdata = NULL
18543  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18544  * cdef int i
18545  * cdef char order = get_best_order(&src, src_ndim)
18546  */
18547  __Pyx_TraceLine(1279,1,__PYX_ERR(2, 1279, __pyx_L1_error))
18548  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18549  __pyx_v_itemsize = __pyx_t_1;
18550 
18551  /* "View.MemoryView":1281
18552  * cdef size_t itemsize = src.memview.view.itemsize
18553  * cdef int i
18554  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
18555  * cdef bint broadcasting = False
18556  * cdef bint direct_copy = False
18557  */
18558  __Pyx_TraceLine(1281,1,__PYX_ERR(2, 1281, __pyx_L1_error))
18559  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18560 
18561  /* "View.MemoryView":1282
18562  * cdef int i
18563  * cdef char order = get_best_order(&src, src_ndim)
18564  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
18565  * cdef bint direct_copy = False
18566  * cdef __Pyx_memviewslice tmp
18567  */
18568  __Pyx_TraceLine(1282,1,__PYX_ERR(2, 1282, __pyx_L1_error))
18569  __pyx_v_broadcasting = 0;
18570 
18571  /* "View.MemoryView":1283
18572  * cdef char order = get_best_order(&src, src_ndim)
18573  * cdef bint broadcasting = False
18574  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
18575  * cdef __Pyx_memviewslice tmp
18576  *
18577  */
18578  __Pyx_TraceLine(1283,1,__PYX_ERR(2, 1283, __pyx_L1_error))
18579  __pyx_v_direct_copy = 0;
18580 
18581  /* "View.MemoryView":1286
18582  * cdef __Pyx_memviewslice tmp
18583  *
18584  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18585  * broadcast_leading(&src, src_ndim, dst_ndim)
18586  * elif dst_ndim < src_ndim:
18587  */
18588  __Pyx_TraceLine(1286,1,__PYX_ERR(2, 1286, __pyx_L1_error))
18589  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
18590  if (__pyx_t_2) {
18591 
18592  /* "View.MemoryView":1287
18593  *
18594  * if src_ndim < dst_ndim:
18595  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18596  * elif dst_ndim < src_ndim:
18597  * broadcast_leading(&dst, dst_ndim, src_ndim)
18598  */
18599  __Pyx_TraceLine(1287,1,__PYX_ERR(2, 1287, __pyx_L1_error))
18600  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18601 
18602  /* "View.MemoryView":1286
18603  * cdef __Pyx_memviewslice tmp
18604  *
18605  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18606  * broadcast_leading(&src, src_ndim, dst_ndim)
18607  * elif dst_ndim < src_ndim:
18608  */
18609  goto __pyx_L3;
18610  }
18611 
18612  /* "View.MemoryView":1288
18613  * if src_ndim < dst_ndim:
18614  * broadcast_leading(&src, src_ndim, dst_ndim)
18615  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18616  * broadcast_leading(&dst, dst_ndim, src_ndim)
18617  *
18618  */
18619  __Pyx_TraceLine(1288,1,__PYX_ERR(2, 1288, __pyx_L1_error))
18620  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
18621  if (__pyx_t_2) {
18622 
18623  /* "View.MemoryView":1289
18624  * broadcast_leading(&src, src_ndim, dst_ndim)
18625  * elif dst_ndim < src_ndim:
18626  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
18627  *
18628  * cdef int ndim = max(src_ndim, dst_ndim)
18629  */
18630  __Pyx_TraceLine(1289,1,__PYX_ERR(2, 1289, __pyx_L1_error))
18631  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18632 
18633  /* "View.MemoryView":1288
18634  * if src_ndim < dst_ndim:
18635  * broadcast_leading(&src, src_ndim, dst_ndim)
18636  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18637  * broadcast_leading(&dst, dst_ndim, src_ndim)
18638  *
18639  */
18640  }
18641  __pyx_L3:;
18642 
18643  /* "View.MemoryView":1291
18644  * broadcast_leading(&dst, dst_ndim, src_ndim)
18645  *
18646  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18647  *
18648  * for i in range(ndim):
18649  */
18650  __Pyx_TraceLine(1291,1,__PYX_ERR(2, 1291, __pyx_L1_error))
18651  __pyx_t_3 = __pyx_v_dst_ndim;
18652  __pyx_t_4 = __pyx_v_src_ndim;
18653  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
18654  __pyx_t_5 = __pyx_t_3;
18655  } else {
18656  __pyx_t_5 = __pyx_t_4;
18657  }
18658  __pyx_v_ndim = __pyx_t_5;
18659 
18660  /* "View.MemoryView":1293
18661  * cdef int ndim = max(src_ndim, dst_ndim)
18662  *
18663  * for i in range(ndim): # <<<<<<<<<<<<<<
18664  * if src.shape[i] != dst.shape[i]:
18665  * if src.shape[i] == 1:
18666  */
18667  __Pyx_TraceLine(1293,1,__PYX_ERR(2, 1293, __pyx_L1_error))
18668  __pyx_t_5 = __pyx_v_ndim;
18669  __pyx_t_3 = __pyx_t_5;
18670  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18671  __pyx_v_i = __pyx_t_4;
18672 
18673  /* "View.MemoryView":1294
18674  *
18675  * for i in range(ndim):
18676  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18677  * if src.shape[i] == 1:
18678  * broadcasting = True
18679  */
18680  __Pyx_TraceLine(1294,1,__PYX_ERR(2, 1294, __pyx_L1_error))
18681  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
18682  if (__pyx_t_2) {
18683 
18684  /* "View.MemoryView":1295
18685  * for i in range(ndim):
18686  * if src.shape[i] != dst.shape[i]:
18687  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18688  * broadcasting = True
18689  * src.strides[i] = 0
18690  */
18691  __Pyx_TraceLine(1295,1,__PYX_ERR(2, 1295, __pyx_L1_error))
18692  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
18693  if (__pyx_t_2) {
18694 
18695  /* "View.MemoryView":1296
18696  * if src.shape[i] != dst.shape[i]:
18697  * if src.shape[i] == 1:
18698  * broadcasting = True # <<<<<<<<<<<<<<
18699  * src.strides[i] = 0
18700  * else:
18701  */
18702  __Pyx_TraceLine(1296,1,__PYX_ERR(2, 1296, __pyx_L1_error))
18703  __pyx_v_broadcasting = 1;
18704 
18705  /* "View.MemoryView":1297
18706  * if src.shape[i] == 1:
18707  * broadcasting = True
18708  * src.strides[i] = 0 # <<<<<<<<<<<<<<
18709  * else:
18710  * _err_extents(i, dst.shape[i], src.shape[i])
18711  */
18712  __Pyx_TraceLine(1297,1,__PYX_ERR(2, 1297, __pyx_L1_error))
18713  (__pyx_v_src.strides[__pyx_v_i]) = 0;
18714 
18715  /* "View.MemoryView":1295
18716  * for i in range(ndim):
18717  * if src.shape[i] != dst.shape[i]:
18718  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18719  * broadcasting = True
18720  * src.strides[i] = 0
18721  */
18722  goto __pyx_L7;
18723  }
18724 
18725  /* "View.MemoryView":1299
18726  * src.strides[i] = 0
18727  * else:
18728  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
18729  *
18730  * if src.suboffsets[i] >= 0:
18731  */
18732  __Pyx_TraceLine(1299,1,__PYX_ERR(2, 1299, __pyx_L1_error))
18733  /*else*/ {
18734  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1299, __pyx_L1_error)
18735  }
18736  __pyx_L7:;
18737 
18738  /* "View.MemoryView":1294
18739  *
18740  * for i in range(ndim):
18741  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18742  * if src.shape[i] == 1:
18743  * broadcasting = True
18744  */
18745  }
18746 
18747  /* "View.MemoryView":1301
18748  * _err_extents(i, dst.shape[i], src.shape[i])
18749  *
18750  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18751  * _err_dim(ValueError, "Dimension %d is not direct", i)
18752  *
18753  */
18754  __Pyx_TraceLine(1301,1,__PYX_ERR(2, 1301, __pyx_L1_error))
18755  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18756  if (__pyx_t_2) {
18757 
18758  /* "View.MemoryView":1302
18759  *
18760  * if src.suboffsets[i] >= 0:
18761  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
18762  *
18763  * if slices_overlap(&src, &dst, ndim, itemsize):
18764  */
18765  __Pyx_TraceLine(1302,1,__PYX_ERR(2, 1302, __pyx_L1_error))
18766  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1302, __pyx_L1_error)
18767 
18768  /* "View.MemoryView":1301
18769  * _err_extents(i, dst.shape[i], src.shape[i])
18770  *
18771  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18772  * _err_dim(ValueError, "Dimension %d is not direct", i)
18773  *
18774  */
18775  }
18776  }
18777 
18778  /* "View.MemoryView":1304
18779  * _err_dim(ValueError, "Dimension %d is not direct", i)
18780  *
18781  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18782  *
18783  * if not slice_is_contig(src, order, ndim):
18784  */
18785  __Pyx_TraceLine(1304,1,__PYX_ERR(2, 1304, __pyx_L1_error))
18786  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
18787  if (__pyx_t_2) {
18788 
18789  /* "View.MemoryView":1306
18790  * if slices_overlap(&src, &dst, ndim, itemsize):
18791  *
18792  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18793  * order = get_best_order(&dst, ndim)
18794  *
18795  */
18796  __Pyx_TraceLine(1306,1,__PYX_ERR(2, 1306, __pyx_L1_error))
18797  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
18798  if (__pyx_t_2) {
18799 
18800  /* "View.MemoryView":1307
18801  *
18802  * if not slice_is_contig(src, order, ndim):
18803  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
18804  *
18805  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18806  */
18807  __Pyx_TraceLine(1307,1,__PYX_ERR(2, 1307, __pyx_L1_error))
18808  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18809 
18810  /* "View.MemoryView":1306
18811  * if slices_overlap(&src, &dst, ndim, itemsize):
18812  *
18813  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18814  * order = get_best_order(&dst, ndim)
18815  *
18816  */
18817  }
18818 
18819  /* "View.MemoryView":1309
18820  * order = get_best_order(&dst, ndim)
18821  *
18822  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
18823  * src = tmp
18824  *
18825  */
18826  __Pyx_TraceLine(1309,1,__PYX_ERR(2, 1309, __pyx_L1_error))
18827  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1309, __pyx_L1_error)
18828  __pyx_v_tmpdata = __pyx_t_7;
18829 
18830  /* "View.MemoryView":1310
18831  *
18832  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18833  * src = tmp # <<<<<<<<<<<<<<
18834  *
18835  * if not broadcasting:
18836  */
18837  __Pyx_TraceLine(1310,1,__PYX_ERR(2, 1310, __pyx_L1_error))
18838  __pyx_v_src = __pyx_v_tmp;
18839 
18840  /* "View.MemoryView":1304
18841  * _err_dim(ValueError, "Dimension %d is not direct", i)
18842  *
18843  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18844  *
18845  * if not slice_is_contig(src, order, ndim):
18846  */
18847  }
18848 
18849  /* "View.MemoryView":1312
18850  * src = tmp
18851  *
18852  * if not broadcasting: # <<<<<<<<<<<<<<
18853  *
18854  *
18855  */
18856  __Pyx_TraceLine(1312,1,__PYX_ERR(2, 1312, __pyx_L1_error))
18857  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
18858  if (__pyx_t_2) {
18859 
18860  /* "View.MemoryView":1315
18861  *
18862  *
18863  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18864  * direct_copy = slice_is_contig(dst, 'C', ndim)
18865  * elif slice_is_contig(src, 'F', ndim):
18866  */
18867  __Pyx_TraceLine(1315,1,__PYX_ERR(2, 1315, __pyx_L1_error))
18868  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
18869  if (__pyx_t_2) {
18870 
18871  /* "View.MemoryView":1316
18872  *
18873  * if slice_is_contig(src, 'C', ndim):
18874  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
18875  * elif slice_is_contig(src, 'F', ndim):
18876  * direct_copy = slice_is_contig(dst, 'F', ndim)
18877  */
18878  __Pyx_TraceLine(1316,1,__PYX_ERR(2, 1316, __pyx_L1_error))
18879  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
18880 
18881  /* "View.MemoryView":1315
18882  *
18883  *
18884  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18885  * direct_copy = slice_is_contig(dst, 'C', ndim)
18886  * elif slice_is_contig(src, 'F', ndim):
18887  */
18888  goto __pyx_L12;
18889  }
18890 
18891  /* "View.MemoryView":1317
18892  * if slice_is_contig(src, 'C', ndim):
18893  * direct_copy = slice_is_contig(dst, 'C', ndim)
18894  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18895  * direct_copy = slice_is_contig(dst, 'F', ndim)
18896  *
18897  */
18898  __Pyx_TraceLine(1317,1,__PYX_ERR(2, 1317, __pyx_L1_error))
18899  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
18900  if (__pyx_t_2) {
18901 
18902  /* "View.MemoryView":1318
18903  * direct_copy = slice_is_contig(dst, 'C', ndim)
18904  * elif slice_is_contig(src, 'F', ndim):
18905  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
18906  *
18907  * if direct_copy:
18908  */
18909  __Pyx_TraceLine(1318,1,__PYX_ERR(2, 1318, __pyx_L1_error))
18910  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
18911 
18912  /* "View.MemoryView":1317
18913  * if slice_is_contig(src, 'C', ndim):
18914  * direct_copy = slice_is_contig(dst, 'C', ndim)
18915  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18916  * direct_copy = slice_is_contig(dst, 'F', ndim)
18917  *
18918  */
18919  }
18920  __pyx_L12:;
18921 
18922  /* "View.MemoryView":1320
18923  * direct_copy = slice_is_contig(dst, 'F', ndim)
18924  *
18925  * if direct_copy: # <<<<<<<<<<<<<<
18926  *
18927  * refcount_copying(&dst, dtype_is_object, ndim, False)
18928  */
18929  __Pyx_TraceLine(1320,1,__PYX_ERR(2, 1320, __pyx_L1_error))
18930  __pyx_t_2 = (__pyx_v_direct_copy != 0);
18931  if (__pyx_t_2) {
18932 
18933  /* "View.MemoryView":1322
18934  * if direct_copy:
18935  *
18936  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
18937  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18938  * refcount_copying(&dst, dtype_is_object, ndim, True)
18939  */
18940  __Pyx_TraceLine(1322,1,__PYX_ERR(2, 1322, __pyx_L1_error))
18941  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18942 
18943  /* "View.MemoryView":1323
18944  *
18945  * refcount_copying(&dst, dtype_is_object, ndim, False)
18946  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
18947  * refcount_copying(&dst, dtype_is_object, ndim, True)
18948  * free(tmpdata)
18949  */
18950  __Pyx_TraceLine(1323,1,__PYX_ERR(2, 1323, __pyx_L1_error))
18951  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18952 
18953  /* "View.MemoryView":1324
18954  * refcount_copying(&dst, dtype_is_object, ndim, False)
18955  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18956  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
18957  * free(tmpdata)
18958  * return 0
18959  */
18960  __Pyx_TraceLine(1324,1,__PYX_ERR(2, 1324, __pyx_L1_error))
18961  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18962 
18963  /* "View.MemoryView":1325
18964  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18965  * refcount_copying(&dst, dtype_is_object, ndim, True)
18966  * free(tmpdata) # <<<<<<<<<<<<<<
18967  * return 0
18968  *
18969  */
18970  __Pyx_TraceLine(1325,1,__PYX_ERR(2, 1325, __pyx_L1_error))
18971  free(__pyx_v_tmpdata);
18972 
18973  /* "View.MemoryView":1326
18974  * refcount_copying(&dst, dtype_is_object, ndim, True)
18975  * free(tmpdata)
18976  * return 0 # <<<<<<<<<<<<<<
18977  *
18978  * if order == 'F' == get_best_order(&dst, ndim):
18979  */
18980  __Pyx_TraceLine(1326,1,__PYX_ERR(2, 1326, __pyx_L1_error))
18981  __pyx_r = 0;
18982  goto __pyx_L0;
18983 
18984  /* "View.MemoryView":1320
18985  * direct_copy = slice_is_contig(dst, 'F', ndim)
18986  *
18987  * if direct_copy: # <<<<<<<<<<<<<<
18988  *
18989  * refcount_copying(&dst, dtype_is_object, ndim, False)
18990  */
18991  }
18992 
18993  /* "View.MemoryView":1312
18994  * src = tmp
18995  *
18996  * if not broadcasting: # <<<<<<<<<<<<<<
18997  *
18998  *
18999  */
19000  }
19001 
19002  /* "View.MemoryView":1328
19003  * return 0
19004  *
19005  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19006  *
19007  *
19008  */
19009  __Pyx_TraceLine(1328,1,__PYX_ERR(2, 1328, __pyx_L1_error))
19010  __pyx_t_2 = (__pyx_v_order == 'F');
19011  if (__pyx_t_2) {
19012  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19013  }
19014  __pyx_t_8 = (__pyx_t_2 != 0);
19015  if (__pyx_t_8) {
19016 
19017  /* "View.MemoryView":1331
19018  *
19019  *
19020  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19021  * transpose_memslice(&dst)
19022  *
19023  */
19024  __Pyx_TraceLine(1331,1,__PYX_ERR(2, 1331, __pyx_L1_error))
19025  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1331, __pyx_L1_error)
19026 
19027  /* "View.MemoryView":1332
19028  *
19029  * transpose_memslice(&src)
19030  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
19031  *
19032  * refcount_copying(&dst, dtype_is_object, ndim, False)
19033  */
19034  __Pyx_TraceLine(1332,1,__PYX_ERR(2, 1332, __pyx_L1_error))
19035  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1332, __pyx_L1_error)
19036 
19037  /* "View.MemoryView":1328
19038  * return 0
19039  *
19040  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19041  *
19042  *
19043  */
19044  }
19045 
19046  /* "View.MemoryView":1334
19047  * transpose_memslice(&dst)
19048  *
19049  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19050  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19051  * refcount_copying(&dst, dtype_is_object, ndim, True)
19052  */
19053  __Pyx_TraceLine(1334,1,__PYX_ERR(2, 1334, __pyx_L1_error))
19054  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19055 
19056  /* "View.MemoryView":1335
19057  *
19058  * refcount_copying(&dst, dtype_is_object, ndim, False)
19059  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19060  * refcount_copying(&dst, dtype_is_object, ndim, True)
19061  *
19062  */
19063  __Pyx_TraceLine(1335,1,__PYX_ERR(2, 1335, __pyx_L1_error))
19064  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19065 
19066  /* "View.MemoryView":1336
19067  * refcount_copying(&dst, dtype_is_object, ndim, False)
19068  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19069  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19070  *
19071  * free(tmpdata)
19072  */
19073  __Pyx_TraceLine(1336,1,__PYX_ERR(2, 1336, __pyx_L1_error))
19074  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19075 
19076  /* "View.MemoryView":1338
19077  * refcount_copying(&dst, dtype_is_object, ndim, True)
19078  *
19079  * free(tmpdata) # <<<<<<<<<<<<<<
19080  * return 0
19081  *
19082  */
19083  __Pyx_TraceLine(1338,1,__PYX_ERR(2, 1338, __pyx_L1_error))
19084  free(__pyx_v_tmpdata);
19085 
19086  /* "View.MemoryView":1339
19087  *
19088  * free(tmpdata)
19089  * return 0 # <<<<<<<<<<<<<<
19090  *
19091  * @cname('__pyx_memoryview_broadcast_leading')
19092  */
19093  __Pyx_TraceLine(1339,1,__PYX_ERR(2, 1339, __pyx_L1_error))
19094  __pyx_r = 0;
19095  goto __pyx_L0;
19096 
19097  /* "View.MemoryView":1270
19098  *
19099  * @cname('__pyx_memoryview_copy_contents')
19100  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19101  * __Pyx_memviewslice dst,
19102  * int src_ndim, int dst_ndim,
19103  */
19104 
19105  /* function exit code */
19106  __pyx_L1_error:;
19107  {
19108  #ifdef WITH_THREAD
19109  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19110  #endif
19111  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19112  #ifdef WITH_THREAD
19113  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19114  #endif
19115  }
19116  __pyx_r = -1;
19117  __pyx_L0:;
19118  __Pyx_TraceReturn(Py_None, 1);
19119  return __pyx_r;
19120 }
19121 
19122 /* "View.MemoryView":1342
19123  *
19124  * @cname('__pyx_memoryview_broadcast_leading')
19125  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19126  * int ndim,
19127  * int ndim_other) nogil:
19128  */
19129 
19130 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19131  int __pyx_v_i;
19132  int __pyx_v_offset;
19133  __Pyx_TraceDeclarations
19134  int __pyx_t_1;
19135  int __pyx_t_2;
19136  int __pyx_t_3;
19137  int __pyx_lineno = 0;
19138  const char *__pyx_filename = NULL;
19139  int __pyx_clineno = 0;
19140  __Pyx_TraceCall("broadcast_leading", __pyx_f[2], 1342, 1, __PYX_ERR(2, 1342, __pyx_L1_error));
19141 
19142  /* "View.MemoryView":1346
19143  * int ndim_other) nogil:
19144  * cdef int i
19145  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
19146  *
19147  * for i in range(ndim - 1, -1, -1):
19148  */
19149  __Pyx_TraceLine(1346,1,__PYX_ERR(2, 1346, __pyx_L1_error))
19150  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19151 
19152  /* "View.MemoryView":1348
19153  * cdef int offset = ndim_other - ndim
19154  *
19155  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19156  * mslice.shape[i + offset] = mslice.shape[i]
19157  * mslice.strides[i + offset] = mslice.strides[i]
19158  */
19159  __Pyx_TraceLine(1348,1,__PYX_ERR(2, 1348, __pyx_L1_error))
19160  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19161  __pyx_v_i = __pyx_t_1;
19162 
19163  /* "View.MemoryView":1349
19164  *
19165  * for i in range(ndim - 1, -1, -1):
19166  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
19167  * mslice.strides[i + offset] = mslice.strides[i]
19168  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19169  */
19170  __Pyx_TraceLine(1349,1,__PYX_ERR(2, 1349, __pyx_L1_error))
19171  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19172 
19173  /* "View.MemoryView":1350
19174  * for i in range(ndim - 1, -1, -1):
19175  * mslice.shape[i + offset] = mslice.shape[i]
19176  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
19177  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19178  *
19179  */
19180  __Pyx_TraceLine(1350,1,__PYX_ERR(2, 1350, __pyx_L1_error))
19181  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19182 
19183  /* "View.MemoryView":1351
19184  * mslice.shape[i + offset] = mslice.shape[i]
19185  * mslice.strides[i + offset] = mslice.strides[i]
19186  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
19187  *
19188  * for i in range(offset):
19189  */
19190  __Pyx_TraceLine(1351,1,__PYX_ERR(2, 1351, __pyx_L1_error))
19191  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19192  }
19193 
19194  /* "View.MemoryView":1353
19195  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19196  *
19197  * for i in range(offset): # <<<<<<<<<<<<<<
19198  * mslice.shape[i] = 1
19199  * mslice.strides[i] = mslice.strides[0]
19200  */
19201  __Pyx_TraceLine(1353,1,__PYX_ERR(2, 1353, __pyx_L1_error))
19202  __pyx_t_1 = __pyx_v_offset;
19203  __pyx_t_2 = __pyx_t_1;
19204  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19205  __pyx_v_i = __pyx_t_3;
19206 
19207  /* "View.MemoryView":1354
19208  *
19209  * for i in range(offset):
19210  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
19211  * mslice.strides[i] = mslice.strides[0]
19212  * mslice.suboffsets[i] = -1
19213  */
19214  __Pyx_TraceLine(1354,1,__PYX_ERR(2, 1354, __pyx_L1_error))
19215  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19216 
19217  /* "View.MemoryView":1355
19218  * for i in range(offset):
19219  * mslice.shape[i] = 1
19220  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
19221  * mslice.suboffsets[i] = -1
19222  *
19223  */
19224  __Pyx_TraceLine(1355,1,__PYX_ERR(2, 1355, __pyx_L1_error))
19225  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19226 
19227  /* "View.MemoryView":1356
19228  * mslice.shape[i] = 1
19229  * mslice.strides[i] = mslice.strides[0]
19230  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19231  *
19232  *
19233  */
19234  __Pyx_TraceLine(1356,1,__PYX_ERR(2, 1356, __pyx_L1_error))
19235  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19236  }
19237 
19238  /* "View.MemoryView":1342
19239  *
19240  * @cname('__pyx_memoryview_broadcast_leading')
19241  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19242  * int ndim,
19243  * int ndim_other) nogil:
19244  */
19245 
19246  /* function exit code */
19247  goto __pyx_L0;
19248  __pyx_L1_error:;
19249  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19250  __pyx_L0:;
19251  __Pyx_TraceReturn(Py_None, 1);
19252 }
19253 
19254 /* "View.MemoryView":1364
19255  *
19256  * @cname('__pyx_memoryview_refcount_copying')
19257  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19258  * int ndim, bint inc) nogil:
19259  *
19260  */
19261 
19262 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
19263  __Pyx_TraceDeclarations
19264  int __pyx_t_1;
19265  int __pyx_lineno = 0;
19266  const char *__pyx_filename = NULL;
19267  int __pyx_clineno = 0;
19268  __Pyx_TraceCall("refcount_copying", __pyx_f[2], 1364, 1, __PYX_ERR(2, 1364, __pyx_L1_error));
19269 
19270  /* "View.MemoryView":1368
19271  *
19272  *
19273  * if dtype_is_object: # <<<<<<<<<<<<<<
19274  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19275  * dst.strides, ndim, inc)
19276  */
19277  __Pyx_TraceLine(1368,1,__PYX_ERR(2, 1368, __pyx_L1_error))
19278  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19279  if (__pyx_t_1) {
19280 
19281  /* "View.MemoryView":1369
19282  *
19283  * if dtype_is_object:
19284  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
19285  * dst.strides, ndim, inc)
19286  *
19287  */
19288  __Pyx_TraceLine(1369,1,__PYX_ERR(2, 1369, __pyx_L1_error))
19289  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19290 
19291  /* "View.MemoryView":1368
19292  *
19293  *
19294  * if dtype_is_object: # <<<<<<<<<<<<<<
19295  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19296  * dst.strides, ndim, inc)
19297  */
19298  }
19299 
19300  /* "View.MemoryView":1364
19301  *
19302  * @cname('__pyx_memoryview_refcount_copying')
19303  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19304  * int ndim, bint inc) nogil:
19305  *
19306  */
19307 
19308  /* function exit code */
19309  goto __pyx_L0;
19310  __pyx_L1_error:;
19311  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19312  __pyx_L0:;
19313  __Pyx_TraceReturn(Py_None, 1);
19314 }
19315 
19316 /* "View.MemoryView":1373
19317  *
19318  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19319  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19320  * Py_ssize_t *strides, int ndim,
19321  * bint inc) with gil:
19322  */
19323 
19324 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19325  __Pyx_TraceDeclarations
19326  __Pyx_RefNannyDeclarations
19327  int __pyx_lineno = 0;
19328  const char *__pyx_filename = NULL;
19329  int __pyx_clineno = 0;
19330  #ifdef WITH_THREAD
19331  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19332  #endif
19333  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
19334  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[2], 1373, 0, __PYX_ERR(2, 1373, __pyx_L1_error));
19335 
19336  /* "View.MemoryView":1376
19337  * Py_ssize_t *strides, int ndim,
19338  * bint inc) with gil:
19339  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
19340  *
19341  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19342  */
19343  __Pyx_TraceLine(1376,0,__PYX_ERR(2, 1376, __pyx_L1_error))
19344  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19345 
19346  /* "View.MemoryView":1373
19347  *
19348  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19349  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19350  * Py_ssize_t *strides, int ndim,
19351  * bint inc) with gil:
19352  */
19353 
19354  /* function exit code */
19355  goto __pyx_L0;
19356  __pyx_L1_error:;
19357  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19358  __pyx_L0:;
19359  __Pyx_TraceReturn(Py_None, 0);
19360  __Pyx_RefNannyFinishContext();
19361  #ifdef WITH_THREAD
19362  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19363  #endif
19364 }
19365 
19366 /* "View.MemoryView":1379
19367  *
19368  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19369  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19370  * Py_ssize_t *strides, int ndim, bint inc):
19371  * cdef Py_ssize_t i
19372  */
19373 
19374 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19375  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19376  __Pyx_TraceDeclarations
19377  __Pyx_RefNannyDeclarations
19378  Py_ssize_t __pyx_t_1;
19379  Py_ssize_t __pyx_t_2;
19380  Py_ssize_t __pyx_t_3;
19381  int __pyx_t_4;
19382  int __pyx_lineno = 0;
19383  const char *__pyx_filename = NULL;
19384  int __pyx_clineno = 0;
19385  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
19386  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[2], 1379, 0, __PYX_ERR(2, 1379, __pyx_L1_error));
19387 
19388  /* "View.MemoryView":1383
19389  * cdef Py_ssize_t i
19390  *
19391  * for i in range(shape[0]): # <<<<<<<<<<<<<<
19392  * if ndim == 1:
19393  * if inc:
19394  */
19395  __Pyx_TraceLine(1383,0,__PYX_ERR(2, 1383, __pyx_L1_error))
19396  __pyx_t_1 = (__pyx_v_shape[0]);
19397  __pyx_t_2 = __pyx_t_1;
19398  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19399  __pyx_v_i = __pyx_t_3;
19400 
19401  /* "View.MemoryView":1384
19402  *
19403  * for i in range(shape[0]):
19404  * if ndim == 1: # <<<<<<<<<<<<<<
19405  * if inc:
19406  * Py_INCREF((<PyObject **> data)[0])
19407  */
19408  __Pyx_TraceLine(1384,0,__PYX_ERR(2, 1384, __pyx_L1_error))
19409  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19410  if (__pyx_t_4) {
19411 
19412  /* "View.MemoryView":1385
19413  * for i in range(shape[0]):
19414  * if ndim == 1:
19415  * if inc: # <<<<<<<<<<<<<<
19416  * Py_INCREF((<PyObject **> data)[0])
19417  * else:
19418  */
19419  __Pyx_TraceLine(1385,0,__PYX_ERR(2, 1385, __pyx_L1_error))
19420  __pyx_t_4 = (__pyx_v_inc != 0);
19421  if (__pyx_t_4) {
19422 
19423  /* "View.MemoryView":1386
19424  * if ndim == 1:
19425  * if inc:
19426  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19427  * else:
19428  * Py_DECREF((<PyObject **> data)[0])
19429  */
19430  __Pyx_TraceLine(1386,0,__PYX_ERR(2, 1386, __pyx_L1_error))
19431  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19432 
19433  /* "View.MemoryView":1385
19434  * for i in range(shape[0]):
19435  * if ndim == 1:
19436  * if inc: # <<<<<<<<<<<<<<
19437  * Py_INCREF((<PyObject **> data)[0])
19438  * else:
19439  */
19440  goto __pyx_L6;
19441  }
19442 
19443  /* "View.MemoryView":1388
19444  * Py_INCREF((<PyObject **> data)[0])
19445  * else:
19446  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19447  * else:
19448  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19449  */
19450  __Pyx_TraceLine(1388,0,__PYX_ERR(2, 1388, __pyx_L1_error))
19451  /*else*/ {
19452  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19453  }
19454  __pyx_L6:;
19455 
19456  /* "View.MemoryView":1384
19457  *
19458  * for i in range(shape[0]):
19459  * if ndim == 1: # <<<<<<<<<<<<<<
19460  * if inc:
19461  * Py_INCREF((<PyObject **> data)[0])
19462  */
19463  goto __pyx_L5;
19464  }
19465 
19466  /* "View.MemoryView":1390
19467  * Py_DECREF((<PyObject **> data)[0])
19468  * else:
19469  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19470  * ndim - 1, inc)
19471  *
19472  */
19473  __Pyx_TraceLine(1390,0,__PYX_ERR(2, 1390, __pyx_L1_error))
19474  /*else*/ {
19475 
19476  /* "View.MemoryView":1391
19477  * else:
19478  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19479  * ndim - 1, inc) # <<<<<<<<<<<<<<
19480  *
19481  * data += strides[0]
19482  */
19483  __Pyx_TraceLine(1391,0,__PYX_ERR(2, 1391, __pyx_L1_error))
19484  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19485  }
19486  __pyx_L5:;
19487 
19488  /* "View.MemoryView":1393
19489  * ndim - 1, inc)
19490  *
19491  * data += strides[0] # <<<<<<<<<<<<<<
19492  *
19493  *
19494  */
19495  __Pyx_TraceLine(1393,0,__PYX_ERR(2, 1393, __pyx_L1_error))
19496  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19497  }
19498 
19499  /* "View.MemoryView":1379
19500  *
19501  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19502  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19503  * Py_ssize_t *strides, int ndim, bint inc):
19504  * cdef Py_ssize_t i
19505  */
19506 
19507  /* function exit code */
19508  goto __pyx_L0;
19509  __pyx_L1_error:;
19510  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19511  __pyx_L0:;
19512  __Pyx_TraceReturn(Py_None, 0);
19513  __Pyx_RefNannyFinishContext();
19514 }
19515 
19516 /* "View.MemoryView":1399
19517  *
19518  * @cname('__pyx_memoryview_slice_assign_scalar')
19519  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19520  * size_t itemsize, void *item,
19521  * bint dtype_is_object) nogil:
19522  */
19523 
19524 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
19525  __Pyx_TraceDeclarations
19526  int __pyx_lineno = 0;
19527  const char *__pyx_filename = NULL;
19528  int __pyx_clineno = 0;
19529  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[2], 1399, 1, __PYX_ERR(2, 1399, __pyx_L1_error));
19530 
19531  /* "View.MemoryView":1402
19532  * size_t itemsize, void *item,
19533  * bint dtype_is_object) nogil:
19534  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19535  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19536  * itemsize, item)
19537  */
19538  __Pyx_TraceLine(1402,1,__PYX_ERR(2, 1402, __pyx_L1_error))
19539  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19540 
19541  /* "View.MemoryView":1403
19542  * bint dtype_is_object) nogil:
19543  * refcount_copying(dst, dtype_is_object, ndim, False)
19544  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
19545  * itemsize, item)
19546  * refcount_copying(dst, dtype_is_object, ndim, True)
19547  */
19548  __Pyx_TraceLine(1403,1,__PYX_ERR(2, 1403, __pyx_L1_error))
19549  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
19550 
19551  /* "View.MemoryView":1405
19552  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19553  * itemsize, item)
19554  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19555  *
19556  *
19557  */
19558  __Pyx_TraceLine(1405,1,__PYX_ERR(2, 1405, __pyx_L1_error))
19559  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19560 
19561  /* "View.MemoryView":1399
19562  *
19563  * @cname('__pyx_memoryview_slice_assign_scalar')
19564  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19565  * size_t itemsize, void *item,
19566  * bint dtype_is_object) nogil:
19567  */
19568 
19569  /* function exit code */
19570  goto __pyx_L0;
19571  __pyx_L1_error:;
19572  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19573  __pyx_L0:;
19574  __Pyx_TraceReturn(Py_None, 1);
19575 }
19576 
19577 /* "View.MemoryView":1409
19578  *
19579  * @cname('__pyx_memoryview__slice_assign_scalar')
19580  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19581  * Py_ssize_t *strides, int ndim,
19582  * size_t itemsize, void *item) nogil:
19583  */
19584 
19585 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
19586  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19587  Py_ssize_t __pyx_v_stride;
19588  Py_ssize_t __pyx_v_extent;
19589  __Pyx_TraceDeclarations
19590  int __pyx_t_1;
19591  Py_ssize_t __pyx_t_2;
19592  Py_ssize_t __pyx_t_3;
19593  Py_ssize_t __pyx_t_4;
19594  int __pyx_lineno = 0;
19595  const char *__pyx_filename = NULL;
19596  int __pyx_clineno = 0;
19597  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[2], 1409, 1, __PYX_ERR(2, 1409, __pyx_L1_error));
19598 
19599  /* "View.MemoryView":1413
19600  * size_t itemsize, void *item) nogil:
19601  * cdef Py_ssize_t i
19602  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
19603  * cdef Py_ssize_t extent = shape[0]
19604  *
19605  */
19606  __Pyx_TraceLine(1413,1,__PYX_ERR(2, 1413, __pyx_L1_error))
19607  __pyx_v_stride = (__pyx_v_strides[0]);
19608 
19609  /* "View.MemoryView":1414
19610  * cdef Py_ssize_t i
19611  * cdef Py_ssize_t stride = strides[0]
19612  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
19613  *
19614  * if ndim == 1:
19615  */
19616  __Pyx_TraceLine(1414,1,__PYX_ERR(2, 1414, __pyx_L1_error))
19617  __pyx_v_extent = (__pyx_v_shape[0]);
19618 
19619  /* "View.MemoryView":1416
19620  * cdef Py_ssize_t extent = shape[0]
19621  *
19622  * if ndim == 1: # <<<<<<<<<<<<<<
19623  * for i in range(extent):
19624  * memcpy(data, item, itemsize)
19625  */
19626  __Pyx_TraceLine(1416,1,__PYX_ERR(2, 1416, __pyx_L1_error))
19627  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19628  if (__pyx_t_1) {
19629 
19630  /* "View.MemoryView":1417
19631  *
19632  * if ndim == 1:
19633  * for i in range(extent): # <<<<<<<<<<<<<<
19634  * memcpy(data, item, itemsize)
19635  * data += stride
19636  */
19637  __Pyx_TraceLine(1417,1,__PYX_ERR(2, 1417, __pyx_L1_error))
19638  __pyx_t_2 = __pyx_v_extent;
19639  __pyx_t_3 = __pyx_t_2;
19640  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19641  __pyx_v_i = __pyx_t_4;
19642 
19643  /* "View.MemoryView":1418
19644  * if ndim == 1:
19645  * for i in range(extent):
19646  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
19647  * data += stride
19648  * else:
19649  */
19650  __Pyx_TraceLine(1418,1,__PYX_ERR(2, 1418, __pyx_L1_error))
19651  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19652 
19653  /* "View.MemoryView":1419
19654  * for i in range(extent):
19655  * memcpy(data, item, itemsize)
19656  * data += stride # <<<<<<<<<<<<<<
19657  * else:
19658  * for i in range(extent):
19659  */
19660  __Pyx_TraceLine(1419,1,__PYX_ERR(2, 1419, __pyx_L1_error))
19661  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19662  }
19663 
19664  /* "View.MemoryView":1416
19665  * cdef Py_ssize_t extent = shape[0]
19666  *
19667  * if ndim == 1: # <<<<<<<<<<<<<<
19668  * for i in range(extent):
19669  * memcpy(data, item, itemsize)
19670  */
19671  goto __pyx_L3;
19672  }
19673 
19674  /* "View.MemoryView":1421
19675  * data += stride
19676  * else:
19677  * for i in range(extent): # <<<<<<<<<<<<<<
19678  * _slice_assign_scalar(data, shape + 1, strides + 1,
19679  * ndim - 1, itemsize, item)
19680  */
19681  __Pyx_TraceLine(1421,1,__PYX_ERR(2, 1421, __pyx_L1_error))
19682  /*else*/ {
19683  __pyx_t_2 = __pyx_v_extent;
19684  __pyx_t_3 = __pyx_t_2;
19685  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19686  __pyx_v_i = __pyx_t_4;
19687 
19688  /* "View.MemoryView":1422
19689  * else:
19690  * for i in range(extent):
19691  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19692  * ndim - 1, itemsize, item)
19693  * data += stride
19694  */
19695  __Pyx_TraceLine(1422,1,__PYX_ERR(2, 1422, __pyx_L1_error))
19696  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
19697 
19698  /* "View.MemoryView":1424
19699  * _slice_assign_scalar(data, shape + 1, strides + 1,
19700  * ndim - 1, itemsize, item)
19701  * data += stride # <<<<<<<<<<<<<<
19702  *
19703  *
19704  */
19705  __Pyx_TraceLine(1424,1,__PYX_ERR(2, 1424, __pyx_L1_error))
19706  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19707  }
19708  }
19709  __pyx_L3:;
19710 
19711  /* "View.MemoryView":1409
19712  *
19713  * @cname('__pyx_memoryview__slice_assign_scalar')
19714  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19715  * Py_ssize_t *strides, int ndim,
19716  * size_t itemsize, void *item) nogil:
19717  */
19718 
19719  /* function exit code */
19720  goto __pyx_L0;
19721  __pyx_L1_error:;
19722  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19723  __pyx_L0:;
19724  __Pyx_TraceReturn(Py_None, 1);
19725 }
19726 
19727 /* "(tree fragment)":1
19728  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19729  * cdef object __pyx_PickleError
19730  * cdef object __pyx_result
19731  */
19732 
19733 /* Python wrapper */
19734 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19735 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
19736 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19737  PyObject *__pyx_v___pyx_type = 0;
19738  long __pyx_v___pyx_checksum;
19739  PyObject *__pyx_v___pyx_state = 0;
19740  int __pyx_lineno = 0;
19741  const char *__pyx_filename = NULL;
19742  int __pyx_clineno = 0;
19743  PyObject *__pyx_r = 0;
19744  __Pyx_RefNannyDeclarations
19745  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
19746  {
19747  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
19748  PyObject* values[3] = {0,0,0};
19749  if (unlikely(__pyx_kwds)) {
19750  Py_ssize_t kw_args;
19751  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19752  switch (pos_args) {
19753  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19754  CYTHON_FALLTHROUGH;
19755  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19756  CYTHON_FALLTHROUGH;
19757  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19758  CYTHON_FALLTHROUGH;
19759  case 0: break;
19760  default: goto __pyx_L5_argtuple_error;
19761  }
19762  kw_args = PyDict_Size(__pyx_kwds);
19763  switch (pos_args) {
19764  case 0:
19765  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
19766  else goto __pyx_L5_argtuple_error;
19767  CYTHON_FALLTHROUGH;
19768  case 1:
19769  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
19770  else {
19771  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
19772  }
19773  CYTHON_FALLTHROUGH;
19774  case 2:
19775  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
19776  else {
19777  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
19778  }
19779  }
19780  if (unlikely(kw_args > 0)) {
19781  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
19782  }
19783  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19784  goto __pyx_L5_argtuple_error;
19785  } else {
19786  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19787  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19788  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19789  }
19790  __pyx_v___pyx_type = values[0];
19791  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
19792  __pyx_v___pyx_state = values[2];
19793  }
19794  goto __pyx_L4_argument_unpacking_done;
19795  __pyx_L5_argtuple_error:;
19796  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
19797  __pyx_L3_error:;
19798  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19799  __Pyx_RefNannyFinishContext();
19800  return NULL;
19801  __pyx_L4_argument_unpacking_done:;
19802  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
19803 
19804  /* function exit code */
19805  __Pyx_RefNannyFinishContext();
19806  return __pyx_r;
19807 }
19808 
19809 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
19810  PyObject *__pyx_v___pyx_PickleError = 0;
19811  PyObject *__pyx_v___pyx_result = 0;
19812  PyObject *__pyx_r = NULL;
19813  __Pyx_TraceDeclarations
19814  __Pyx_RefNannyDeclarations
19815  PyObject *__pyx_t_1 = NULL;
19816  int __pyx_t_2;
19817  int __pyx_t_3;
19818  PyObject *__pyx_t_4 = NULL;
19819  PyObject *__pyx_t_5 = NULL;
19820  PyObject *__pyx_t_6 = NULL;
19821  int __pyx_lineno = 0;
19822  const char *__pyx_filename = NULL;
19823  int __pyx_clineno = 0;
19824  __Pyx_TraceFrameInit(__pyx_codeobj__21)
19825  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
19826  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
19827 
19828  /* "(tree fragment)":4
19829  * cdef object __pyx_PickleError
19830  * cdef object __pyx_result
19831  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
19832  * from pickle import PickleError as __pyx_PickleError
19833  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19834  */
19835  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
19836  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
19837  __Pyx_GOTREF(__pyx_t_1);
19838  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__22, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error)
19839  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19840  __pyx_t_3 = (__pyx_t_2 != 0);
19841  if (__pyx_t_3) {
19842 
19843  /* "(tree fragment)":5
19844  * cdef object __pyx_result
19845  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
19846  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
19847  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19848  * __pyx_result = Enum.__new__(__pyx_type)
19849  */
19850  __Pyx_TraceLine(5,0,__PYX_ERR(2, 5, __pyx_L1_error))
19851  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
19852  __Pyx_GOTREF(__pyx_t_1);
19853  __Pyx_INCREF(__pyx_n_s_PickleError);
19854  __Pyx_GIVEREF(__pyx_n_s_PickleError);
19855  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
19856  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
19857  __Pyx_GOTREF(__pyx_t_4);
19858  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19859  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
19860  __Pyx_GOTREF(__pyx_t_1);
19861  __Pyx_INCREF(__pyx_t_1);
19862  __pyx_v___pyx_PickleError = __pyx_t_1;
19863  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19864  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19865 
19866  /* "(tree fragment)":6
19867  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
19868  * from pickle import PickleError as __pyx_PickleError
19869  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
19870  * __pyx_result = Enum.__new__(__pyx_type)
19871  * if __pyx_state is not None:
19872  */
19873  __Pyx_TraceLine(6,0,__PYX_ERR(2, 6, __pyx_L1_error))
19874  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
19875  __Pyx_GOTREF(__pyx_t_1);
19876  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error)
19877  __Pyx_GOTREF(__pyx_t_5);
19878  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19879  __Pyx_INCREF(__pyx_v___pyx_PickleError);
19880  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
19881  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
19882  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
19883  if (likely(__pyx_t_6)) {
19884  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
19885  __Pyx_INCREF(__pyx_t_6);
19886  __Pyx_INCREF(function);
19887  __Pyx_DECREF_SET(__pyx_t_1, function);
19888  }
19889  }
19890  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
19891  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19892  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19893  if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
19894  __Pyx_GOTREF(__pyx_t_4);
19895  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19896  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19897  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19898  __PYX_ERR(2, 6, __pyx_L1_error)
19899 
19900  /* "(tree fragment)":4
19901  * cdef object __pyx_PickleError
19902  * cdef object __pyx_result
19903  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
19904  * from pickle import PickleError as __pyx_PickleError
19905  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19906  */
19907  }
19908 
19909  /* "(tree fragment)":7
19910  * from pickle import PickleError as __pyx_PickleError
19911  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19912  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
19913  * if __pyx_state is not None:
19914  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19915  */
19916  __Pyx_TraceLine(7,0,__PYX_ERR(2, 7, __pyx_L1_error))
19917  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
19918  __Pyx_GOTREF(__pyx_t_1);
19919  __pyx_t_5 = NULL;
19920  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
19921  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
19922  if (likely(__pyx_t_5)) {
19923  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
19924  __Pyx_INCREF(__pyx_t_5);
19925  __Pyx_INCREF(function);
19926  __Pyx_DECREF_SET(__pyx_t_1, function);
19927  }
19928  }
19929  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
19930  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19931  if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error)
19932  __Pyx_GOTREF(__pyx_t_4);
19933  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19934  __pyx_v___pyx_result = __pyx_t_4;
19935  __pyx_t_4 = 0;
19936 
19937  /* "(tree fragment)":8
19938  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19939  * __pyx_result = Enum.__new__(__pyx_type)
19940  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19941  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19942  * return __pyx_result
19943  */
19944  __Pyx_TraceLine(8,0,__PYX_ERR(2, 8, __pyx_L1_error))
19945  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
19946  __pyx_t_2 = (__pyx_t_3 != 0);
19947  if (__pyx_t_2) {
19948 
19949  /* "(tree fragment)":9
19950  * __pyx_result = Enum.__new__(__pyx_type)
19951  * if __pyx_state is not None:
19952  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
19953  * return __pyx_result
19954  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19955  */
19956  __Pyx_TraceLine(9,0,__PYX_ERR(2, 9, __pyx_L1_error))
19957  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
19958  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 9, __pyx_L1_error)
19959  __Pyx_GOTREF(__pyx_t_4);
19960  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19961 
19962  /* "(tree fragment)":8
19963  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19964  * __pyx_result = Enum.__new__(__pyx_type)
19965  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19966  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19967  * return __pyx_result
19968  */
19969  }
19970 
19971  /* "(tree fragment)":10
19972  * if __pyx_state is not None:
19973  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19974  * return __pyx_result # <<<<<<<<<<<<<<
19975  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19976  * __pyx_result.name = __pyx_state[0]
19977  */
19978  __Pyx_TraceLine(10,0,__PYX_ERR(2, 10, __pyx_L1_error))
19979  __Pyx_XDECREF(__pyx_r);
19980  __Pyx_INCREF(__pyx_v___pyx_result);
19981  __pyx_r = __pyx_v___pyx_result;
19982  goto __pyx_L0;
19983 
19984  /* "(tree fragment)":1
19985  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19986  * cdef object __pyx_PickleError
19987  * cdef object __pyx_result
19988  */
19989 
19990  /* function exit code */
19991  __pyx_L1_error:;
19992  __Pyx_XDECREF(__pyx_t_1);
19993  __Pyx_XDECREF(__pyx_t_4);
19994  __Pyx_XDECREF(__pyx_t_5);
19995  __Pyx_XDECREF(__pyx_t_6);
19996  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19997  __pyx_r = NULL;
19998  __pyx_L0:;
19999  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20000  __Pyx_XDECREF(__pyx_v___pyx_result);
20001  __Pyx_XGIVEREF(__pyx_r);
20002  __Pyx_TraceReturn(__pyx_r, 0);
20003  __Pyx_RefNannyFinishContext();
20004  return __pyx_r;
20005 }
20006 
20007 /* "(tree fragment)":11
20008  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20009  * return __pyx_result
20010  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20011  * __pyx_result.name = __pyx_state[0]
20012  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20013  */
20014 
20015 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20016  PyObject *__pyx_r = NULL;
20017  __Pyx_TraceDeclarations
20018  __Pyx_RefNannyDeclarations
20019  PyObject *__pyx_t_1 = NULL;
20020  int __pyx_t_2;
20021  Py_ssize_t __pyx_t_3;
20022  int __pyx_t_4;
20023  int __pyx_t_5;
20024  PyObject *__pyx_t_6 = NULL;
20025  PyObject *__pyx_t_7 = NULL;
20026  PyObject *__pyx_t_8 = NULL;
20027  int __pyx_lineno = 0;
20028  const char *__pyx_filename = NULL;
20029  int __pyx_clineno = 0;
20030  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20031  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
20032 
20033  /* "(tree fragment)":12
20034  * return __pyx_result
20035  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20036  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20037  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20038  * __pyx_result.__dict__.update(__pyx_state[1])
20039  */
20040  __Pyx_TraceLine(12,0,__PYX_ERR(2, 12, __pyx_L1_error))
20041  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20042  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20043  __PYX_ERR(2, 12, __pyx_L1_error)
20044  }
20045  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
20046  __Pyx_GOTREF(__pyx_t_1);
20047  __Pyx_GIVEREF(__pyx_t_1);
20048  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20049  __Pyx_DECREF(__pyx_v___pyx_result->name);
20050  __pyx_v___pyx_result->name = __pyx_t_1;
20051  __pyx_t_1 = 0;
20052 
20053  /* "(tree fragment)":13
20054  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20055  * __pyx_result.name = __pyx_state[0]
20056  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20057  * __pyx_result.__dict__.update(__pyx_state[1])
20058  */
20059  __Pyx_TraceLine(13,0,__PYX_ERR(2, 13, __pyx_L1_error))
20060  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20061  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20062  __PYX_ERR(2, 13, __pyx_L1_error)
20063  }
20064  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
20065  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20066  if (__pyx_t_4) {
20067  } else {
20068  __pyx_t_2 = __pyx_t_4;
20069  goto __pyx_L4_bool_binop_done;
20070  }
20071  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
20072  __pyx_t_5 = (__pyx_t_4 != 0);
20073  __pyx_t_2 = __pyx_t_5;
20074  __pyx_L4_bool_binop_done:;
20075  if (__pyx_t_2) {
20076 
20077  /* "(tree fragment)":14
20078  * __pyx_result.name = __pyx_state[0]
20079  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20080  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20081  */
20082  __Pyx_TraceLine(14,0,__PYX_ERR(2, 14, __pyx_L1_error))
20083  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
20084  __Pyx_GOTREF(__pyx_t_6);
20085  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
20086  __Pyx_GOTREF(__pyx_t_7);
20087  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20088  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20089  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20090  __PYX_ERR(2, 14, __pyx_L1_error)
20091  }
20092  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
20093  __Pyx_GOTREF(__pyx_t_6);
20094  __pyx_t_8 = NULL;
20095  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20096  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20097  if (likely(__pyx_t_8)) {
20098  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20099  __Pyx_INCREF(__pyx_t_8);
20100  __Pyx_INCREF(function);
20101  __Pyx_DECREF_SET(__pyx_t_7, function);
20102  }
20103  }
20104  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20105  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20106  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20107  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
20108  __Pyx_GOTREF(__pyx_t_1);
20109  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20110  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20111 
20112  /* "(tree fragment)":13
20113  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20114  * __pyx_result.name = __pyx_state[0]
20115  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20116  * __pyx_result.__dict__.update(__pyx_state[1])
20117  */
20118  }
20119 
20120  /* "(tree fragment)":11
20121  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20122  * return __pyx_result
20123  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20124  * __pyx_result.name = __pyx_state[0]
20125  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20126  */
20127 
20128  /* function exit code */
20129  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20130  goto __pyx_L0;
20131  __pyx_L1_error:;
20132  __Pyx_XDECREF(__pyx_t_1);
20133  __Pyx_XDECREF(__pyx_t_6);
20134  __Pyx_XDECREF(__pyx_t_7);
20135  __Pyx_XDECREF(__pyx_t_8);
20136  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20137  __pyx_r = 0;
20138  __pyx_L0:;
20139  __Pyx_XGIVEREF(__pyx_r);
20140  __Pyx_TraceReturn(__pyx_r, 0);
20141  __Pyx_RefNannyFinishContext();
20142  return __pyx_r;
20143 }
20144 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20145 
20146 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20147  struct __pyx_array_obj *p;
20148  PyObject *o;
20149  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20150  o = (*t->tp_alloc)(t, 0);
20151  } else {
20152  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20153  }
20154  if (unlikely(!o)) return 0;
20155  p = ((struct __pyx_array_obj *)o);
20156  p->__pyx_vtab = __pyx_vtabptr_array;
20157  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20158  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20159  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
20160  return o;
20161  bad:
20162  Py_DECREF(o); o = 0;
20163  return NULL;
20164 }
20165 
20166 static void __pyx_tp_dealloc_array(PyObject *o) {
20167  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
20168  #if CYTHON_USE_TP_FINALIZE
20169  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
20170  if (PyObject_CallFinalizerFromDealloc(o)) return;
20171  }
20172  #endif
20173  {
20174  PyObject *etype, *eval, *etb;
20175  PyErr_Fetch(&etype, &eval, &etb);
20176  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20177  __pyx_array___dealloc__(o);
20178  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20179  PyErr_Restore(etype, eval, etb);
20180  }
20181  Py_CLEAR(p->mode);
20182  Py_CLEAR(p->_format);
20183  (*Py_TYPE(o)->tp_free)(o);
20184 }
20185 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20186  PyObject *r;
20187  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20188  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20189  Py_DECREF(x);
20190  return r;
20191 }
20192 
20193 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20194  if (v) {
20195  return __pyx_array___setitem__(o, i, v);
20196  }
20197  else {
20198  PyErr_Format(PyExc_NotImplementedError,
20199  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20200  return -1;
20201  }
20202 }
20203 
20204 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
20205  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
20206  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20207  PyErr_Clear();
20208  v = __pyx_array___getattr__(o, n);
20209  }
20210  return v;
20211 }
20212 
20213 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
20214  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20215 }
20216 
20217 static PyMethodDef __pyx_methods_array[] = {
20218  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20219  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20220  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20221  {0, 0, 0, 0}
20222 };
20223 
20224 static struct PyGetSetDef __pyx_getsets_array[] = {
20225  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
20226  {0, 0, 0, 0, 0}
20227 };
20228 
20229 static PySequenceMethods __pyx_tp_as_sequence_array = {
20230  __pyx_array___len__, /*sq_length*/
20231  0, /*sq_concat*/
20232  0, /*sq_repeat*/
20233  __pyx_sq_item_array, /*sq_item*/
20234  0, /*sq_slice*/
20235  0, /*sq_ass_item*/
20236  0, /*sq_ass_slice*/
20237  0, /*sq_contains*/
20238  0, /*sq_inplace_concat*/
20239  0, /*sq_inplace_repeat*/
20240 };
20241 
20242 static PyMappingMethods __pyx_tp_as_mapping_array = {
20243  __pyx_array___len__, /*mp_length*/
20244  __pyx_array___getitem__, /*mp_subscript*/
20245  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
20246 };
20247 
20248 static PyBufferProcs __pyx_tp_as_buffer_array = {
20249  #if PY_MAJOR_VERSION < 3
20250  0, /*bf_getreadbuffer*/
20251  #endif
20252  #if PY_MAJOR_VERSION < 3
20253  0, /*bf_getwritebuffer*/
20254  #endif
20255  #if PY_MAJOR_VERSION < 3
20256  0, /*bf_getsegcount*/
20257  #endif
20258  #if PY_MAJOR_VERSION < 3
20259  0, /*bf_getcharbuffer*/
20260  #endif
20261  __pyx_array_getbuffer, /*bf_getbuffer*/
20262  0, /*bf_releasebuffer*/
20263 };
20264 
20265 static PyTypeObject __pyx_type___pyx_array = {
20266  PyVarObject_HEAD_INIT(0, 0)
20267  "imate._c_trace_estimator.py_c_trace_estimator.array", /*tp_name*/
20268  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
20269  0, /*tp_itemsize*/
20270  __pyx_tp_dealloc_array, /*tp_dealloc*/
20271  #if PY_VERSION_HEX < 0x030800b4
20272  0, /*tp_print*/
20273  #endif
20274  #if PY_VERSION_HEX >= 0x030800b4
20275  0, /*tp_vectorcall_offset*/
20276  #endif
20277  0, /*tp_getattr*/
20278  0, /*tp_setattr*/
20279  #if PY_MAJOR_VERSION < 3
20280  0, /*tp_compare*/
20281  #endif
20282  #if PY_MAJOR_VERSION >= 3
20283  0, /*tp_as_async*/
20284  #endif
20285  0, /*tp_repr*/
20286  0, /*tp_as_number*/
20287  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
20288  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
20289  0, /*tp_hash*/
20290  0, /*tp_call*/
20291  0, /*tp_str*/
20292  __pyx_tp_getattro_array, /*tp_getattro*/
20293  0, /*tp_setattro*/
20294  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
20295  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20296  0, /*tp_doc*/
20297  0, /*tp_traverse*/
20298  0, /*tp_clear*/
20299  0, /*tp_richcompare*/
20300  0, /*tp_weaklistoffset*/
20301  0, /*tp_iter*/
20302  0, /*tp_iternext*/
20303  __pyx_methods_array, /*tp_methods*/
20304  0, /*tp_members*/
20305  __pyx_getsets_array, /*tp_getset*/
20306  0, /*tp_base*/
20307  0, /*tp_dict*/
20308  0, /*tp_descr_get*/
20309  0, /*tp_descr_set*/
20310  0, /*tp_dictoffset*/
20311  0, /*tp_init*/
20312  0, /*tp_alloc*/
20313  __pyx_tp_new_array, /*tp_new*/
20314  0, /*tp_free*/
20315  0, /*tp_is_gc*/
20316  0, /*tp_bases*/
20317  0, /*tp_mro*/
20318  0, /*tp_cache*/
20319  0, /*tp_subclasses*/
20320  0, /*tp_weaklist*/
20321  0, /*tp_del*/
20322  0, /*tp_version_tag*/
20323  #if PY_VERSION_HEX >= 0x030400a1
20324  0, /*tp_finalize*/
20325  #endif
20326  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20327  0, /*tp_vectorcall*/
20328  #endif
20329  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20330  0, /*tp_print*/
20331  #endif
20332  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20333  0, /*tp_pypy_flags*/
20334  #endif
20335 };
20336 
20337 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20338  struct __pyx_MemviewEnum_obj *p;
20339  PyObject *o;
20340  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20341  o = (*t->tp_alloc)(t, 0);
20342  } else {
20343  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20344  }
20345  if (unlikely(!o)) return 0;
20346  p = ((struct __pyx_MemviewEnum_obj *)o);
20347  p->name = Py_None; Py_INCREF(Py_None);
20348  return o;
20349 }
20350 
20351 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20352  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20353  #if CYTHON_USE_TP_FINALIZE
20354  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20355  if (PyObject_CallFinalizerFromDealloc(o)) return;
20356  }
20357  #endif
20358  PyObject_GC_UnTrack(o);
20359  Py_CLEAR(p->name);
20360  (*Py_TYPE(o)->tp_free)(o);
20361 }
20362 
20363 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
20364  int e;
20365  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20366  if (p->name) {
20367  e = (*v)(p->name, a); if (e) return e;
20368  }
20369  return 0;
20370 }
20371 
20372 static int __pyx_tp_clear_Enum(PyObject *o) {
20373  PyObject* tmp;
20374  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20375  tmp = ((PyObject*)p->name);
20376  p->name = Py_None; Py_INCREF(Py_None);
20377  Py_XDECREF(tmp);
20378  return 0;
20379 }
20380 
20381 static PyMethodDef __pyx_methods_Enum[] = {
20382  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20383  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20384  {0, 0, 0, 0}
20385 };
20386 
20387 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20388  PyVarObject_HEAD_INIT(0, 0)
20389  "imate._c_trace_estimator.py_c_trace_estimator.Enum", /*tp_name*/
20390  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
20391  0, /*tp_itemsize*/
20392  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
20393  #if PY_VERSION_HEX < 0x030800b4
20394  0, /*tp_print*/
20395  #endif
20396  #if PY_VERSION_HEX >= 0x030800b4
20397  0, /*tp_vectorcall_offset*/
20398  #endif
20399  0, /*tp_getattr*/
20400  0, /*tp_setattr*/
20401  #if PY_MAJOR_VERSION < 3
20402  0, /*tp_compare*/
20403  #endif
20404  #if PY_MAJOR_VERSION >= 3
20405  0, /*tp_as_async*/
20406  #endif
20407  __pyx_MemviewEnum___repr__, /*tp_repr*/
20408  0, /*tp_as_number*/
20409  0, /*tp_as_sequence*/
20410  0, /*tp_as_mapping*/
20411  0, /*tp_hash*/
20412  0, /*tp_call*/
20413  0, /*tp_str*/
20414  0, /*tp_getattro*/
20415  0, /*tp_setattro*/
20416  0, /*tp_as_buffer*/
20417  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20418  0, /*tp_doc*/
20419  __pyx_tp_traverse_Enum, /*tp_traverse*/
20420  __pyx_tp_clear_Enum, /*tp_clear*/
20421  0, /*tp_richcompare*/
20422  0, /*tp_weaklistoffset*/
20423  0, /*tp_iter*/
20424  0, /*tp_iternext*/
20425  __pyx_methods_Enum, /*tp_methods*/
20426  0, /*tp_members*/
20427  0, /*tp_getset*/
20428  0, /*tp_base*/
20429  0, /*tp_dict*/
20430  0, /*tp_descr_get*/
20431  0, /*tp_descr_set*/
20432  0, /*tp_dictoffset*/
20433  __pyx_MemviewEnum___init__, /*tp_init*/
20434  0, /*tp_alloc*/
20435  __pyx_tp_new_Enum, /*tp_new*/
20436  0, /*tp_free*/
20437  0, /*tp_is_gc*/
20438  0, /*tp_bases*/
20439  0, /*tp_mro*/
20440  0, /*tp_cache*/
20441  0, /*tp_subclasses*/
20442  0, /*tp_weaklist*/
20443  0, /*tp_del*/
20444  0, /*tp_version_tag*/
20445  #if PY_VERSION_HEX >= 0x030400a1
20446  0, /*tp_finalize*/
20447  #endif
20448  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20449  0, /*tp_vectorcall*/
20450  #endif
20451  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20452  0, /*tp_print*/
20453  #endif
20454  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20455  0, /*tp_pypy_flags*/
20456  #endif
20457 };
20458 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20459 
20460 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20461  struct __pyx_memoryview_obj *p;
20462  PyObject *o;
20463  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20464  o = (*t->tp_alloc)(t, 0);
20465  } else {
20466  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20467  }
20468  if (unlikely(!o)) return 0;
20469  p = ((struct __pyx_memoryview_obj *)o);
20470  p->__pyx_vtab = __pyx_vtabptr_memoryview;
20471  p->obj = Py_None; Py_INCREF(Py_None);
20472  p->_size = Py_None; Py_INCREF(Py_None);
20473  p->_array_interface = Py_None; Py_INCREF(Py_None);
20474  p->view.obj = NULL;
20475  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
20476  return o;
20477  bad:
20478  Py_DECREF(o); o = 0;
20479  return NULL;
20480 }
20481 
20482 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20483  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20484  #if CYTHON_USE_TP_FINALIZE
20485  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20486  if (PyObject_CallFinalizerFromDealloc(o)) return;
20487  }
20488  #endif
20489  PyObject_GC_UnTrack(o);
20490  {
20491  PyObject *etype, *eval, *etb;
20492  PyErr_Fetch(&etype, &eval, &etb);
20493  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20494  __pyx_memoryview___dealloc__(o);
20495  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20496  PyErr_Restore(etype, eval, etb);
20497  }
20498  Py_CLEAR(p->obj);
20499  Py_CLEAR(p->_size);
20500  Py_CLEAR(p->_array_interface);
20501  (*Py_TYPE(o)->tp_free)(o);
20502 }
20503 
20504 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
20505  int e;
20506  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20507  if (p->obj) {
20508  e = (*v)(p->obj, a); if (e) return e;
20509  }
20510  if (p->_size) {
20511  e = (*v)(p->_size, a); if (e) return e;
20512  }
20513  if (p->_array_interface) {
20514  e = (*v)(p->_array_interface, a); if (e) return e;
20515  }
20516  if (p->view.obj) {
20517  e = (*v)(p->view.obj, a); if (e) return e;
20518  }
20519  return 0;
20520 }
20521 
20522 static int __pyx_tp_clear_memoryview(PyObject *o) {
20523  PyObject* tmp;
20524  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20525  tmp = ((PyObject*)p->obj);
20526  p->obj = Py_None; Py_INCREF(Py_None);
20527  Py_XDECREF(tmp);
20528  tmp = ((PyObject*)p->_size);
20529  p->_size = Py_None; Py_INCREF(Py_None);
20530  Py_XDECREF(tmp);
20531  tmp = ((PyObject*)p->_array_interface);
20532  p->_array_interface = Py_None; Py_INCREF(Py_None);
20533  Py_XDECREF(tmp);
20534  Py_CLEAR(p->view.obj);
20535  return 0;
20536 }
20537 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20538  PyObject *r;
20539  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20540  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20541  Py_DECREF(x);
20542  return r;
20543 }
20544 
20545 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
20546  if (v) {
20547  return __pyx_memoryview___setitem__(o, i, v);
20548  }
20549  else {
20550  PyErr_Format(PyExc_NotImplementedError,
20551  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20552  return -1;
20553  }
20554 }
20555 
20556 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
20557  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20558 }
20559 
20560 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
20561  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20562 }
20563 
20564 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
20565  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20566 }
20567 
20568 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
20569  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20570 }
20571 
20572 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
20573  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20574 }
20575 
20576 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
20577  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20578 }
20579 
20580 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
20581  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20582 }
20583 
20584 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
20585  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20586 }
20587 
20588 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
20589  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20590 }
20591 
20592 static PyMethodDef __pyx_methods_memoryview[] = {
20593  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20594  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20595  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20596  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20597  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20598  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20599  {0, 0, 0, 0}
20600 };
20601 
20602 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20603  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
20604  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
20605  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
20606  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
20607  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
20608  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
20609  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
20610  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
20611  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
20612  {0, 0, 0, 0, 0}
20613 };
20614 
20615 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20616  __pyx_memoryview___len__, /*sq_length*/
20617  0, /*sq_concat*/
20618  0, /*sq_repeat*/
20619  __pyx_sq_item_memoryview, /*sq_item*/
20620  0, /*sq_slice*/
20621  0, /*sq_ass_item*/
20622  0, /*sq_ass_slice*/
20623  0, /*sq_contains*/
20624  0, /*sq_inplace_concat*/
20625  0, /*sq_inplace_repeat*/
20626 };
20627 
20628 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20629  __pyx_memoryview___len__, /*mp_length*/
20630  __pyx_memoryview___getitem__, /*mp_subscript*/
20631  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
20632 };
20633 
20634 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20635  #if PY_MAJOR_VERSION < 3
20636  0, /*bf_getreadbuffer*/
20637  #endif
20638  #if PY_MAJOR_VERSION < 3
20639  0, /*bf_getwritebuffer*/
20640  #endif
20641  #if PY_MAJOR_VERSION < 3
20642  0, /*bf_getsegcount*/
20643  #endif
20644  #if PY_MAJOR_VERSION < 3
20645  0, /*bf_getcharbuffer*/
20646  #endif
20647  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
20648  0, /*bf_releasebuffer*/
20649 };
20650 
20651 static PyTypeObject __pyx_type___pyx_memoryview = {
20652  PyVarObject_HEAD_INIT(0, 0)
20653  "imate._c_trace_estimator.py_c_trace_estimator.memoryview", /*tp_name*/
20654  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
20655  0, /*tp_itemsize*/
20656  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
20657  #if PY_VERSION_HEX < 0x030800b4
20658  0, /*tp_print*/
20659  #endif
20660  #if PY_VERSION_HEX >= 0x030800b4
20661  0, /*tp_vectorcall_offset*/
20662  #endif
20663  0, /*tp_getattr*/
20664  0, /*tp_setattr*/
20665  #if PY_MAJOR_VERSION < 3
20666  0, /*tp_compare*/
20667  #endif
20668  #if PY_MAJOR_VERSION >= 3
20669  0, /*tp_as_async*/
20670  #endif
20671  __pyx_memoryview___repr__, /*tp_repr*/
20672  0, /*tp_as_number*/
20673  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
20674  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
20675  0, /*tp_hash*/
20676  0, /*tp_call*/
20677  __pyx_memoryview___str__, /*tp_str*/
20678  0, /*tp_getattro*/
20679  0, /*tp_setattro*/
20680  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
20681  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20682  0, /*tp_doc*/
20683  __pyx_tp_traverse_memoryview, /*tp_traverse*/
20684  __pyx_tp_clear_memoryview, /*tp_clear*/
20685  0, /*tp_richcompare*/
20686  0, /*tp_weaklistoffset*/
20687  0, /*tp_iter*/
20688  0, /*tp_iternext*/
20689  __pyx_methods_memoryview, /*tp_methods*/
20690  0, /*tp_members*/
20691  __pyx_getsets_memoryview, /*tp_getset*/
20692  0, /*tp_base*/
20693  0, /*tp_dict*/
20694  0, /*tp_descr_get*/
20695  0, /*tp_descr_set*/
20696  0, /*tp_dictoffset*/
20697  0, /*tp_init*/
20698  0, /*tp_alloc*/
20699  __pyx_tp_new_memoryview, /*tp_new*/
20700  0, /*tp_free*/
20701  0, /*tp_is_gc*/
20702  0, /*tp_bases*/
20703  0, /*tp_mro*/
20704  0, /*tp_cache*/
20705  0, /*tp_subclasses*/
20706  0, /*tp_weaklist*/
20707  0, /*tp_del*/
20708  0, /*tp_version_tag*/
20709  #if PY_VERSION_HEX >= 0x030400a1
20710  0, /*tp_finalize*/
20711  #endif
20712  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20713  0, /*tp_vectorcall*/
20714  #endif
20715  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20716  0, /*tp_print*/
20717  #endif
20718  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20719  0, /*tp_pypy_flags*/
20720  #endif
20721 };
20722 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
20723 
20724 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
20725  struct __pyx_memoryviewslice_obj *p;
20726  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
20727  if (unlikely(!o)) return 0;
20728  p = ((struct __pyx_memoryviewslice_obj *)o);
20729  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
20730  p->from_object = Py_None; Py_INCREF(Py_None);
20731  p->from_slice.memview = NULL;
20732  return o;
20733 }
20734 
20735 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
20736  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20737  #if CYTHON_USE_TP_FINALIZE
20738  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20739  if (PyObject_CallFinalizerFromDealloc(o)) return;
20740  }
20741  #endif
20742  PyObject_GC_UnTrack(o);
20743  {
20744  PyObject *etype, *eval, *etb;
20745  PyErr_Fetch(&etype, &eval, &etb);
20746  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20747  __pyx_memoryviewslice___dealloc__(o);
20748  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20749  PyErr_Restore(etype, eval, etb);
20750  }
20751  Py_CLEAR(p->from_object);
20752  PyObject_GC_Track(o);
20753  __pyx_tp_dealloc_memoryview(o);
20754 }
20755 
20756 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
20757  int e;
20758  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20759  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
20760  if (p->from_object) {
20761  e = (*v)(p->from_object, a); if (e) return e;
20762  }
20763  return 0;
20764 }
20765 
20766 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
20767  PyObject* tmp;
20768  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20769  __pyx_tp_clear_memoryview(o);
20770  tmp = ((PyObject*)p->from_object);
20771  p->from_object = Py_None; Py_INCREF(Py_None);
20772  Py_XDECREF(tmp);
20773  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
20774  return 0;
20775 }
20776 
20777 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
20778  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
20779 }
20780 
20781 static PyMethodDef __pyx_methods__memoryviewslice[] = {
20782  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
20783  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
20784  {0, 0, 0, 0}
20785 };
20786 
20787 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
20788  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
20789  {0, 0, 0, 0, 0}
20790 };
20791 
20792 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
20793  PyVarObject_HEAD_INIT(0, 0)
20794  "imate._c_trace_estimator.py_c_trace_estimator._memoryviewslice", /*tp_name*/
20795  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
20796  0, /*tp_itemsize*/
20797  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
20798  #if PY_VERSION_HEX < 0x030800b4
20799  0, /*tp_print*/
20800  #endif
20801  #if PY_VERSION_HEX >= 0x030800b4
20802  0, /*tp_vectorcall_offset*/
20803  #endif
20804  0, /*tp_getattr*/
20805  0, /*tp_setattr*/
20806  #if PY_MAJOR_VERSION < 3
20807  0, /*tp_compare*/
20808  #endif
20809  #if PY_MAJOR_VERSION >= 3
20810  0, /*tp_as_async*/
20811  #endif
20812  #if CYTHON_COMPILING_IN_PYPY
20813  __pyx_memoryview___repr__, /*tp_repr*/
20814  #else
20815  0, /*tp_repr*/
20816  #endif
20817  0, /*tp_as_number*/
20818  0, /*tp_as_sequence*/
20819  0, /*tp_as_mapping*/
20820  0, /*tp_hash*/
20821  0, /*tp_call*/
20822  #if CYTHON_COMPILING_IN_PYPY
20823  __pyx_memoryview___str__, /*tp_str*/
20824  #else
20825  0, /*tp_str*/
20826  #endif
20827  0, /*tp_getattro*/
20828  0, /*tp_setattro*/
20829  0, /*tp_as_buffer*/
20830  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20831  "Internal class for passing memoryview slices to Python", /*tp_doc*/
20832  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
20833  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
20834  0, /*tp_richcompare*/
20835  0, /*tp_weaklistoffset*/
20836  0, /*tp_iter*/
20837  0, /*tp_iternext*/
20838  __pyx_methods__memoryviewslice, /*tp_methods*/
20839  0, /*tp_members*/
20840  __pyx_getsets__memoryviewslice, /*tp_getset*/
20841  0, /*tp_base*/
20842  0, /*tp_dict*/
20843  0, /*tp_descr_get*/
20844  0, /*tp_descr_set*/
20845  0, /*tp_dictoffset*/
20846  0, /*tp_init*/
20847  0, /*tp_alloc*/
20848  __pyx_tp_new__memoryviewslice, /*tp_new*/
20849  0, /*tp_free*/
20850  0, /*tp_is_gc*/
20851  0, /*tp_bases*/
20852  0, /*tp_mro*/
20853  0, /*tp_cache*/
20854  0, /*tp_subclasses*/
20855  0, /*tp_weaklist*/
20856  0, /*tp_del*/
20857  0, /*tp_version_tag*/
20858  #if PY_VERSION_HEX >= 0x030400a1
20859  0, /*tp_finalize*/
20860  #endif
20861  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20862  0, /*tp_vectorcall*/
20863  #endif
20864  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20865  0, /*tp_print*/
20866  #endif
20867  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20868  0, /*tp_pypy_flags*/
20869  #endif
20870 };
20871 
20872 static PyMethodDef __pyx_methods[] = {
20873  {0, 0, 0, 0}
20874 };
20875 
20876 #if PY_MAJOR_VERSION >= 3
20877 #if CYTHON_PEP489_MULTI_PHASE_INIT
20878 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
20879 static int __pyx_pymod_exec_py_c_trace_estimator(PyObject* module); /*proto*/
20880 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
20881  {Py_mod_create, (void*)__pyx_pymod_create},
20882  {Py_mod_exec, (void*)__pyx_pymod_exec_py_c_trace_estimator},
20883  {0, NULL}
20884 };
20885 #endif
20886 
20887 static struct PyModuleDef __pyx_moduledef = {
20888  PyModuleDef_HEAD_INIT,
20889  "py_c_trace_estimator",
20890  0, /* m_doc */
20891  #if CYTHON_PEP489_MULTI_PHASE_INIT
20892  0, /* m_size */
20893  #else
20894  -1, /* m_size */
20895  #endif
20896  __pyx_methods /* m_methods */,
20897  #if CYTHON_PEP489_MULTI_PHASE_INIT
20898  __pyx_moduledef_slots, /* m_slots */
20899  #else
20900  NULL, /* m_reload */
20901  #endif
20902  NULL, /* m_traverse */
20903  NULL, /* m_clear */
20904  NULL /* m_free */
20905 };
20906 #endif
20907 #ifndef CYTHON_SMALL_CODE
20908 #if defined(__clang__)
20909  #define CYTHON_SMALL_CODE
20910 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
20911  #define CYTHON_SMALL_CODE __attribute__((cold))
20912 #else
20913  #define CYTHON_SMALL_CODE
20914 #endif
20915 #endif
20916 
20917 static __Pyx_StringTabEntry __pyx_string_tab[] = {
20918  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
20919  {&__pyx_n_s_Aop, __pyx_k_Aop, sizeof(__pyx_k_Aop), 0, 0, 1, 1},
20920  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
20921  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
20922  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
20923  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
20924  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
20925  {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa, sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
20926  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
20927  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
20928  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
20929  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
20930  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
20931  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
20932  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
20933  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
20934  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
20935  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
20936  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
20937  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
20938  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
20939  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
20940  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
20941  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
20942  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
20943  {&__pyx_n_s_alg_wall_times, __pyx_k_alg_wall_times, sizeof(__pyx_k_alg_wall_times), 0, 0, 1, 1},
20944  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
20945  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
20946  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
20947  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
20948  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
20949  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
20950  {&__pyx_n_s_confidence_level, __pyx_k_confidence_level, sizeof(__pyx_k_confidence_level), 0, 0, 1, 1},
20951  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
20952  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
20953  {&__pyx_n_s_converged, __pyx_k_converged, sizeof(__pyx_k_converged), 0, 0, 1, 1},
20954  {&__pyx_n_s_data_type_name, __pyx_k_data_type_name, sizeof(__pyx_k_data_type_name), 0, 0, 1, 1},
20955  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
20956  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
20957  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
20958  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
20959  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
20960  {&__pyx_n_s_error_atol, __pyx_k_error_atol, sizeof(__pyx_k_error_atol), 0, 0, 1, 1},
20961  {&__pyx_n_s_error_rtol, __pyx_k_error_rtol, sizeof(__pyx_k_error_rtol), 0, 0, 1, 1},
20962  {&__pyx_n_s_exponent, __pyx_k_exponent, sizeof(__pyx_k_exponent), 0, 0, 1, 1},
20963  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
20964  {&__pyx_n_b_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 0, 1},
20965  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
20966  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
20967  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
20968  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
20969  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
20970  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
20971  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
20972  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
20973  {&__pyx_kp_s_imate__c_trace_estimator_py_c_tr, __pyx_k_imate__c_trace_estimator_py_c_tr, sizeof(__pyx_k_imate__c_trace_estimator_py_c_tr), 0, 0, 1, 0},
20974  {&__pyx_n_s_imate__c_trace_estimator_py_c_tr_2, __pyx_k_imate__c_trace_estimator_py_c_tr_2, sizeof(__pyx_k_imate__c_trace_estimator_py_c_tr_2), 0, 0, 1, 1},
20975  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
20976  {&__pyx_n_s_isscalar, __pyx_k_isscalar, sizeof(__pyx_k_isscalar), 0, 0, 1, 1},
20977  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
20978  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
20979  {&__pyx_n_s_lanczos_degree, __pyx_k_lanczos_degree, sizeof(__pyx_k_lanczos_degree), 0, 0, 1, 1},
20980  {&__pyx_n_s_lanczos_tol, __pyx_k_lanczos_tol, sizeof(__pyx_k_lanczos_tol), 0, 0, 1, 1},
20981  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
20982  {&__pyx_n_s_max_num_samples, __pyx_k_max_num_samples, sizeof(__pyx_k_max_num_samples), 0, 0, 1, 1},
20983  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
20984  {&__pyx_n_s_min_num_samples, __pyx_k_min_num_samples, sizeof(__pyx_k_min_num_samples), 0, 0, 1, 1},
20985  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
20986  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
20987  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
20988  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
20989  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
20990  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
20991  {&__pyx_n_s_num_inquiries, __pyx_k_num_inquiries, sizeof(__pyx_k_num_inquiries), 0, 0, 1, 1},
20992  {&__pyx_n_s_num_outliers, __pyx_k_num_outliers, sizeof(__pyx_k_num_outliers), 0, 0, 1, 1},
20993  {&__pyx_n_s_num_samples_used, __pyx_k_num_samples_used, sizeof(__pyx_k_num_samples_used), 0, 0, 1, 1},
20994  {&__pyx_n_s_num_threads, __pyx_k_num_threads, sizeof(__pyx_k_num_threads), 0, 0, 1, 1},
20995  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
20996  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
20997  {&__pyx_n_s_outlier_significance_level, __pyx_k_outlier_significance_level, sizeof(__pyx_k_outlier_significance_level), 0, 0, 1, 1},
20998  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
20999  {&__pyx_n_s_parameters, __pyx_k_parameters, sizeof(__pyx_k_parameters), 0, 0, 1, 1},
21000  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21001  {&__pyx_n_s_processed_samples_indices, __pyx_k_processed_samples_indices, sizeof(__pyx_k_processed_samples_indices), 0, 0, 1, 1},
21002  {&__pyx_n_s_py_matrix_function, __pyx_k_py_matrix_function, sizeof(__pyx_k_py_matrix_function), 0, 0, 1, 1},
21003  {&__pyx_n_s_pyc_trace_estimator, __pyx_k_pyc_trace_estimator, sizeof(__pyx_k_pyc_trace_estimator), 0, 0, 1, 1},
21004  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21005  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21006  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21007  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21008  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21009  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21010  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21011  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21012  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
21013  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21014  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21015  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21016  {&__pyx_n_s_reorthogonalize, __pyx_k_reorthogonalize, sizeof(__pyx_k_reorthogonalize), 0, 0, 1, 1},
21017  {&__pyx_n_s_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 0, 1, 1},
21018  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21019  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21020  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
21021  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
21022  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
21023  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
21024  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
21025  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21026  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21027  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21028  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21029  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
21030  {&__pyx_n_s_symmetric, __pyx_k_symmetric, sizeof(__pyx_k_symmetric), 0, 0, 1, 1},
21031  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
21032  {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1},
21033  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21034  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21035  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21036  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
21037  {0, 0, 0, 0, 0, 0, 0}
21038 };
21039 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
21040  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 155, __pyx_L1_error)
21041  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 224, __pyx_L1_error)
21042  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 134, __pyx_L1_error)
21043  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 149, __pyx_L1_error)
21044  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 152, __pyx_L1_error)
21045  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 406, __pyx_L1_error)
21046  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 615, __pyx_L1_error)
21047  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 834, __pyx_L1_error)
21048  return 0;
21049  __pyx_L1_error:;
21050  return -1;
21051 }
21052 
21053 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21054  __Pyx_RefNannyDeclarations
21055  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21056 
21057  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":155
21058  *
21059  * else:
21060  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
21061  * '"float128".')
21062  *
21063  */
21064  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 155, __pyx_L1_error)
21065  __Pyx_GOTREF(__pyx_tuple__2);
21066  __Pyx_GIVEREF(__pyx_tuple__2);
21067 
21068  /* "View.MemoryView":134
21069  *
21070  * if not self.ndim:
21071  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
21072  *
21073  * if itemsize <= 0:
21074  */
21075  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 134, __pyx_L1_error)
21076  __Pyx_GOTREF(__pyx_tuple__3);
21077  __Pyx_GIVEREF(__pyx_tuple__3);
21078 
21079  /* "View.MemoryView":137
21080  *
21081  * if itemsize <= 0:
21082  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
21083  *
21084  * if not isinstance(format, bytes):
21085  */
21086  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 137, __pyx_L1_error)
21087  __Pyx_GOTREF(__pyx_tuple__4);
21088  __Pyx_GIVEREF(__pyx_tuple__4);
21089 
21090  /* "View.MemoryView":149
21091  *
21092  * if not self._shape:
21093  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
21094  *
21095  *
21096  */
21097  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 149, __pyx_L1_error)
21098  __Pyx_GOTREF(__pyx_tuple__5);
21099  __Pyx_GIVEREF(__pyx_tuple__5);
21100 
21101  /* "View.MemoryView":177
21102  * self.data = <char *>malloc(self.len)
21103  * if not self.data:
21104  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
21105  *
21106  * if self.dtype_is_object:
21107  */
21108  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 177, __pyx_L1_error)
21109  __Pyx_GOTREF(__pyx_tuple__6);
21110  __Pyx_GIVEREF(__pyx_tuple__6);
21111 
21112  /* "View.MemoryView":193
21113  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21114  * if not (flags & bufmode):
21115  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
21116  * info.buf = self.data
21117  * info.len = self.len
21118  */
21119  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 193, __pyx_L1_error)
21120  __Pyx_GOTREF(__pyx_tuple__7);
21121  __Pyx_GIVEREF(__pyx_tuple__7);
21122 
21123  /* "(tree fragment)":2
21124  * def __reduce_cython__(self):
21125  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21126  * def __setstate_cython__(self, __pyx_state):
21127  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21128  */
21129  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 2, __pyx_L1_error)
21130  __Pyx_GOTREF(__pyx_tuple__8);
21131  __Pyx_GIVEREF(__pyx_tuple__8);
21132 
21133  /* "(tree fragment)":4
21134  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21135  * def __setstate_cython__(self, __pyx_state):
21136  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21137  */
21138  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 4, __pyx_L1_error)
21139  __Pyx_GOTREF(__pyx_tuple__9);
21140  __Pyx_GIVEREF(__pyx_tuple__9);
21141 
21142  /* "View.MemoryView":420
21143  * def __setitem__(memoryview self, object index, object value):
21144  * if self.view.readonly:
21145  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
21146  *
21147  * have_slices, index = _unellipsify(index, self.view.ndim)
21148  */
21149  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 420, __pyx_L1_error)
21150  __Pyx_GOTREF(__pyx_tuple__10);
21151  __Pyx_GIVEREF(__pyx_tuple__10);
21152 
21153  /* "View.MemoryView":497
21154  * result = struct.unpack(self.view.format, bytesitem)
21155  * except struct.error:
21156  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
21157  * else:
21158  * if len(self.view.format) == 1:
21159  */
21160  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 497, __pyx_L1_error)
21161  __Pyx_GOTREF(__pyx_tuple__11);
21162  __Pyx_GIVEREF(__pyx_tuple__11);
21163 
21164  /* "View.MemoryView":522
21165  * def __getbuffer__(self, Py_buffer *info, int flags):
21166  * if flags & PyBUF_WRITABLE and self.view.readonly:
21167  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
21168  *
21169  * if flags & PyBUF_ND:
21170  */
21171  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 522, __pyx_L1_error)
21172  __Pyx_GOTREF(__pyx_tuple__12);
21173  __Pyx_GIVEREF(__pyx_tuple__12);
21174 
21175  /* "View.MemoryView":572
21176  * if self.view.strides == NULL:
21177  *
21178  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
21179  *
21180  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
21181  */
21182  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 572, __pyx_L1_error)
21183  __Pyx_GOTREF(__pyx_tuple__13);
21184  __Pyx_GIVEREF(__pyx_tuple__13);
21185 
21186  /* "View.MemoryView":579
21187  * def suboffsets(self):
21188  * if self.view.suboffsets == NULL:
21189  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
21190  *
21191  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
21192  */
21193  __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 579, __pyx_L1_error)
21194  __Pyx_GOTREF(__pyx_tuple__14);
21195  __Pyx_INCREF(__pyx_int_neg_1);
21196  __Pyx_GIVEREF(__pyx_int_neg_1);
21197  PyTuple_SET_ITEM(__pyx_tuple__14, 0, __pyx_int_neg_1);
21198  __Pyx_GIVEREF(__pyx_tuple__14);
21199 
21200  /* "(tree fragment)":2
21201  * def __reduce_cython__(self):
21202  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21203  * def __setstate_cython__(self, __pyx_state):
21204  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21205  */
21206  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 2, __pyx_L1_error)
21207  __Pyx_GOTREF(__pyx_tuple__15);
21208  __Pyx_GIVEREF(__pyx_tuple__15);
21209 
21210  /* "(tree fragment)":4
21211  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21212  * def __setstate_cython__(self, __pyx_state):
21213  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21214  */
21215  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 4, __pyx_L1_error)
21216  __Pyx_GOTREF(__pyx_tuple__16);
21217  __Pyx_GIVEREF(__pyx_tuple__16);
21218 
21219  /* "View.MemoryView":684
21220  * if item is Ellipsis:
21221  * if not seen_ellipsis:
21222  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
21223  * seen_ellipsis = True
21224  * else:
21225  */
21226  __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(2, 684, __pyx_L1_error)
21227  __Pyx_GOTREF(__pyx_slice__17);
21228  __Pyx_GIVEREF(__pyx_slice__17);
21229 
21230  /* "View.MemoryView":705
21231  * for suboffset in suboffsets[:ndim]:
21232  * if suboffset >= 0:
21233  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
21234  *
21235  *
21236  */
21237  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 705, __pyx_L1_error)
21238  __Pyx_GOTREF(__pyx_tuple__18);
21239  __Pyx_GIVEREF(__pyx_tuple__18);
21240 
21241  /* "(tree fragment)":2
21242  * def __reduce_cython__(self):
21243  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21244  * def __setstate_cython__(self, __pyx_state):
21245  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21246  */
21247  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 2, __pyx_L1_error)
21248  __Pyx_GOTREF(__pyx_tuple__19);
21249  __Pyx_GIVEREF(__pyx_tuple__19);
21250 
21251  /* "(tree fragment)":4
21252  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21253  * def __setstate_cython__(self, __pyx_state):
21254  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21255  */
21256  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 4, __pyx_L1_error)
21257  __Pyx_GOTREF(__pyx_tuple__20);
21258  __Pyx_GIVEREF(__pyx_tuple__20);
21259  __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 4, __pyx_L1_error)
21260  __Pyx_GOTREF(__pyx_tuple__22);
21261  __Pyx_GIVEREF(__pyx_tuple__22);
21262 
21263  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":38
21264  * # ===================
21265  *
21266  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
21267  * pycLinearOperator Aop,
21268  * parameters,
21269  */
21270  __pyx_tuple__23 = PyTuple_Pack(25, __pyx_n_s_Aop, __pyx_n_s_parameters, __pyx_n_s_num_inquiries, __pyx_n_s_py_matrix_function, __pyx_n_s_exponent, __pyx_n_s_symmetric, __pyx_n_s_reorthogonalize, __pyx_n_s_lanczos_degree, __pyx_n_s_lanczos_tol, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_num_threads, __pyx_n_s_data_type_name, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_samples_used, __pyx_n_s_num_outliers, __pyx_n_s_converged, __pyx_n_s_alg_wall_times); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 38, __pyx_L1_error)
21271  __Pyx_GOTREF(__pyx_tuple__23);
21272  __Pyx_GIVEREF(__pyx_tuple__23);
21273  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(25, 0, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_trace_estimator_py_c_tr, __pyx_n_s_pyc_trace_estimator, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 38, __pyx_L1_error)
21274 
21275  /* "View.MemoryView":287
21276  * return self.name
21277  *
21278  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21279  * cdef strided = Enum("<strided and direct>") # default
21280  * cdef indirect = Enum("<strided and indirect>")
21281  */
21282  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 287, __pyx_L1_error)
21283  __Pyx_GOTREF(__pyx_tuple__24);
21284  __Pyx_GIVEREF(__pyx_tuple__24);
21285 
21286  /* "View.MemoryView":288
21287  *
21288  * cdef generic = Enum("<strided and direct or indirect>")
21289  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21290  * cdef indirect = Enum("<strided and indirect>")
21291  *
21292  */
21293  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 288, __pyx_L1_error)
21294  __Pyx_GOTREF(__pyx_tuple__25);
21295  __Pyx_GIVEREF(__pyx_tuple__25);
21296 
21297  /* "View.MemoryView":289
21298  * cdef generic = Enum("<strided and direct or indirect>")
21299  * cdef strided = Enum("<strided and direct>") # default
21300  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21301  *
21302  *
21303  */
21304  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 289, __pyx_L1_error)
21305  __Pyx_GOTREF(__pyx_tuple__26);
21306  __Pyx_GIVEREF(__pyx_tuple__26);
21307 
21308  /* "View.MemoryView":292
21309  *
21310  *
21311  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21312  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21313  *
21314  */
21315  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 292, __pyx_L1_error)
21316  __Pyx_GOTREF(__pyx_tuple__27);
21317  __Pyx_GIVEREF(__pyx_tuple__27);
21318 
21319  /* "View.MemoryView":293
21320  *
21321  * cdef contiguous = Enum("<contiguous and direct>")
21322  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21323  *
21324  *
21325  */
21326  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 293, __pyx_L1_error)
21327  __Pyx_GOTREF(__pyx_tuple__28);
21328  __Pyx_GIVEREF(__pyx_tuple__28);
21329 
21330  /* "(tree fragment)":1
21331  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21332  * cdef object __pyx_PickleError
21333  * cdef object __pyx_result
21334  */
21335  __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 1, __pyx_L1_error)
21336  __Pyx_GOTREF(__pyx_tuple__29);
21337  __Pyx_GIVEREF(__pyx_tuple__29);
21338  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(2, 1, __pyx_L1_error)
21339  __Pyx_RefNannyFinishContext();
21340  return 0;
21341  __pyx_L1_error:;
21342  __Pyx_RefNannyFinishContext();
21343  return -1;
21344 }
21345 
21346 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
21347  /* AssertionsEnabled.init */
21348  __Pyx_init_assertions_enabled();
21349 
21350 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21351 
21352  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21353  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
21354  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21355  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
21356  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
21357  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
21358  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21359  return 0;
21360  __pyx_L1_error:;
21361  return -1;
21362 }
21363 
21364 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
21365 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
21366 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
21367 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
21368 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
21369 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
21370 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
21371 
21372 static int __Pyx_modinit_global_init_code(void) {
21373  __Pyx_RefNannyDeclarations
21374  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21375  /*--- Global init code ---*/
21376  generic = Py_None; Py_INCREF(Py_None);
21377  strided = Py_None; Py_INCREF(Py_None);
21378  indirect = Py_None; Py_INCREF(Py_None);
21379  contiguous = Py_None; Py_INCREF(Py_None);
21380  indirect_contiguous = Py_None; Py_INCREF(Py_None);
21381  __Pyx_RefNannyFinishContext();
21382  return 0;
21383 }
21384 
21385 static int __Pyx_modinit_variable_export_code(void) {
21386  __Pyx_RefNannyDeclarations
21387  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21388  /*--- Variable export code ---*/
21389  __Pyx_RefNannyFinishContext();
21390  return 0;
21391 }
21392 
21393 static int __Pyx_modinit_function_export_code(void) {
21394  __Pyx_RefNannyDeclarations
21395  int __pyx_lineno = 0;
21396  const char *__pyx_filename = NULL;
21397  int __pyx_clineno = 0;
21398  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21399  /*--- Function export code ---*/
21400  if (__Pyx_ExportFunction("pyc_trace_estimator", (void (*)(void))__pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator, "__pyx_t_5imate_12_definitions_5types_FlagType (struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21401  __Pyx_RefNannyFinishContext();
21402  return 0;
21403  __pyx_L1_error:;
21404  __Pyx_RefNannyFinishContext();
21405  return -1;
21406 }
21407 
21408 static int __Pyx_modinit_type_init_code(void) {
21409  __Pyx_RefNannyDeclarations
21410  int __pyx_lineno = 0;
21411  const char *__pyx_filename = NULL;
21412  int __pyx_clineno = 0;
21413  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
21414  /*--- Type init code ---*/
21415  __pyx_vtabptr_array = &__pyx_vtable_array;
21416  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
21417  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
21418  #if PY_VERSION_HEX < 0x030800B1
21419  __pyx_type___pyx_array.tp_print = 0;
21420  #endif
21421  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
21422  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
21423  __pyx_array_type = &__pyx_type___pyx_array;
21424  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error)
21425  #if PY_VERSION_HEX < 0x030800B1
21426  __pyx_type___pyx_MemviewEnum.tp_print = 0;
21427  #endif
21428  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21429  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21430  }
21431  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error)
21432  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21433  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21434  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21435  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21436  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21437  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21438  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21439  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
21440  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21441  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
21442  #if PY_VERSION_HEX < 0x030800B1
21443  __pyx_type___pyx_memoryview.tp_print = 0;
21444  #endif
21445  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21446  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21447  }
21448  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
21449  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
21450  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
21451  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
21452  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
21453  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
21454  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
21455  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
21456  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
21457  #if PY_VERSION_HEX < 0x030800B1
21458  __pyx_type___pyx_memoryviewslice.tp_print = 0;
21459  #endif
21460  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
21461  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21462  }
21463  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
21464  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
21465  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
21466  __Pyx_RefNannyFinishContext();
21467  return 0;
21468  __pyx_L1_error:;
21469  __Pyx_RefNannyFinishContext();
21470  return -1;
21471 }
21472 
21473 static int __Pyx_modinit_type_import_code(void) {
21474  __Pyx_RefNannyDeclarations
21475  PyObject *__pyx_t_1 = NULL;
21476  int __pyx_lineno = 0;
21477  const char *__pyx_filename = NULL;
21478  int __pyx_clineno = 0;
21479  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
21480  /*--- Type import code ---*/
21481  __pyx_t_1 = PyImport_ImportModule("imate.functions.py_functions"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 20, __pyx_L1_error)
21482  __Pyx_GOTREF(__pyx_t_1);
21483  __pyx_ptype_5imate_9functions_12py_functions_pyFunction = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate.functions.py_functions", "pyFunction", sizeof(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_9functions_12py_functions_pyFunction) __PYX_ERR(3, 20, __pyx_L1_error)
21484  __pyx_vtabptr_5imate_9functions_12py_functions_pyFunction = (struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction*)__Pyx_GetVtable(__pyx_ptype_5imate_9functions_12py_functions_pyFunction->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_9functions_12py_functions_pyFunction)) __PYX_ERR(3, 20, __pyx_L1_error)
21485  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21486  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_linear_operator"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
21487  __Pyx_GOTREF(__pyx_t_1);
21488  __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_linear_operator", "pycLinearOperator", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(4, 23, __pyx_L1_error)
21489  __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(4, 23, __pyx_L1_error)
21490  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21491  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_matrix"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 21, __pyx_L1_error)
21492  __Pyx_GOTREF(__pyx_t_1);
21493  __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_matrix", "pycMatrix", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) __PYX_ERR(5, 21, __pyx_L1_error)
21494  __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix)) __PYX_ERR(5, 21, __pyx_L1_error)
21495  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21496  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_affine_matrix_function"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 21, __pyx_L1_error)
21497  __Pyx_GOTREF(__pyx_t_1);
21498  __pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_affine_matrix_function", "pycAffineMatrixFunction", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) __PYX_ERR(6, 21, __pyx_L1_error)
21499  __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction)) __PYX_ERR(6, 21, __pyx_L1_error)
21500  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21501  __Pyx_RefNannyFinishContext();
21502  return 0;
21503  __pyx_L1_error:;
21504  __Pyx_XDECREF(__pyx_t_1);
21505  __Pyx_RefNannyFinishContext();
21506  return -1;
21507 }
21508 
21509 static int __Pyx_modinit_variable_import_code(void) {
21510  __Pyx_RefNannyDeclarations
21511  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
21512  /*--- Variable import code ---*/
21513  __Pyx_RefNannyFinishContext();
21514  return 0;
21515 }
21516 
21517 static int __Pyx_modinit_function_import_code(void) {
21518  __Pyx_RefNannyDeclarations
21519  PyObject *__pyx_t_1 = NULL;
21520  int __pyx_lineno = 0;
21521  const char *__pyx_filename = NULL;
21522  int __pyx_clineno = 0;
21523  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
21524  /*--- Function import code ---*/
21525  __pyx_t_1 = PyImport_ImportModule("scipy.linalg.cython_lapack"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
21526  __Pyx_GOTREF(__pyx_t_1);
21527  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "dbdsdc", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dbdsdc, "void (char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21528  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "dstev", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dstev, "void (char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21529  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "sbdsdc", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_sbdsdc, "void (char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21530  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "sstev", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_sstev, "void (char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21531  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21532  __Pyx_RefNannyFinishContext();
21533  return 0;
21534  __pyx_L1_error:;
21535  __Pyx_XDECREF(__pyx_t_1);
21536  __Pyx_RefNannyFinishContext();
21537  return -1;
21538 }
21539 
21540 
21541 #ifndef CYTHON_NO_PYINIT_EXPORT
21542 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21543 #elif PY_MAJOR_VERSION < 3
21544 #ifdef __cplusplus
21545 #define __Pyx_PyMODINIT_FUNC extern "C" void
21546 #else
21547 #define __Pyx_PyMODINIT_FUNC void
21548 #endif
21549 #else
21550 #ifdef __cplusplus
21551 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
21552 #else
21553 #define __Pyx_PyMODINIT_FUNC PyObject *
21554 #endif
21555 #endif
21556 
21557 
21558 #if PY_MAJOR_VERSION < 3
21559 __Pyx_PyMODINIT_FUNC initpy_c_trace_estimator(void) CYTHON_SMALL_CODE; /*proto*/
21560 __Pyx_PyMODINIT_FUNC initpy_c_trace_estimator(void)
21561 #else
21562 __Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void) CYTHON_SMALL_CODE; /*proto*/
21563 __Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void)
21564 #if CYTHON_PEP489_MULTI_PHASE_INIT
21565 {
21566  return PyModuleDef_Init(&__pyx_moduledef);
21567 }
21568 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
21569  #if PY_VERSION_HEX >= 0x030700A1
21570  static PY_INT64_T main_interpreter_id = -1;
21571  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21572  if (main_interpreter_id == -1) {
21573  main_interpreter_id = current_id;
21574  return (unlikely(current_id == -1)) ? -1 : 0;
21575  } else if (unlikely(main_interpreter_id != current_id))
21576  #else
21577  static PyInterpreterState *main_interpreter = NULL;
21578  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21579  if (!main_interpreter) {
21580  main_interpreter = current_interpreter;
21581  } else if (unlikely(main_interpreter != current_interpreter))
21582  #endif
21583  {
21584  PyErr_SetString(
21585  PyExc_ImportError,
21586  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21587  return -1;
21588  }
21589  return 0;
21590 }
21591 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
21592  PyObject *value = PyObject_GetAttrString(spec, from_name);
21593  int result = 0;
21594  if (likely(value)) {
21595  if (allow_none || value != Py_None) {
21596  result = PyDict_SetItemString(moddict, to_name, value);
21597  }
21598  Py_DECREF(value);
21599  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21600  PyErr_Clear();
21601  } else {
21602  result = -1;
21603  }
21604  return result;
21605 }
21606 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21607  PyObject *module = NULL, *moddict, *modname;
21608  if (__Pyx_check_single_interpreter())
21609  return NULL;
21610  if (__pyx_m)
21611  return __Pyx_NewRef(__pyx_m);
21612  modname = PyObject_GetAttrString(spec, "name");
21613  if (unlikely(!modname)) goto bad;
21614  module = PyModule_NewObject(modname);
21615  Py_DECREF(modname);
21616  if (unlikely(!module)) goto bad;
21617  moddict = PyModule_GetDict(module);
21618  if (unlikely(!moddict)) goto bad;
21619  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
21620  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
21621  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
21622  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
21623  return module;
21624 bad:
21625  Py_XDECREF(module);
21626  return NULL;
21627 }
21628 
21629 
21630 static CYTHON_SMALL_CODE int __pyx_pymod_exec_py_c_trace_estimator(PyObject *__pyx_pyinit_module)
21631 #endif
21632 #endif
21633 {
21634  __Pyx_TraceDeclarations
21635  PyObject *__pyx_t_1 = NULL;
21636  static PyThread_type_lock __pyx_t_2[8];
21637  int __pyx_lineno = 0;
21638  const char *__pyx_filename = NULL;
21639  int __pyx_clineno = 0;
21640  __Pyx_RefNannyDeclarations
21641  #if CYTHON_PEP489_MULTI_PHASE_INIT
21642  if (__pyx_m) {
21643  if (__pyx_m == __pyx_pyinit_module) return 0;
21644  PyErr_SetString(PyExc_RuntimeError, "Module 'py_c_trace_estimator' has already been imported. Re-initialisation is not supported.");
21645  return -1;
21646  }
21647  #elif PY_MAJOR_VERSION >= 3
21648  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
21649  #endif
21650  #if CYTHON_REFNANNY
21651 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
21652 if (!__Pyx_RefNanny) {
21653  PyErr_Clear();
21654  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
21655  if (!__Pyx_RefNanny)
21656  Py_FatalError("failed to import 'refnanny' module");
21657 }
21658 #endif
21659  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void)", 0);
21660  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21661  #ifdef __Pxy_PyFrame_Initialize_Offsets
21662  __Pxy_PyFrame_Initialize_Offsets();
21663  #endif
21664  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
21665  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
21666  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
21667  #ifdef __Pyx_CyFunction_USED
21668  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21669  #endif
21670  #ifdef __Pyx_FusedFunction_USED
21671  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21672  #endif
21673  #ifdef __Pyx_Coroutine_USED
21674  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21675  #endif
21676  #ifdef __Pyx_Generator_USED
21677  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21678  #endif
21679  #ifdef __Pyx_AsyncGen_USED
21680  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21681  #endif
21682  #ifdef __Pyx_StopAsyncIteration_USED
21683  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21684  #endif
21685  /*--- Library function declarations ---*/
21686  /*--- Threads initialization code ---*/
21687  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
21688  PyEval_InitThreads();
21689  #endif
21690  /*--- Module creation code ---*/
21691  #if CYTHON_PEP489_MULTI_PHASE_INIT
21692  __pyx_m = __pyx_pyinit_module;
21693  Py_INCREF(__pyx_m);
21694  #else
21695  #if PY_MAJOR_VERSION < 3
21696  __pyx_m = Py_InitModule4("py_c_trace_estimator", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
21697  #else
21698  __pyx_m = PyModule_Create(&__pyx_moduledef);
21699  #endif
21700  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
21701  #endif
21702  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
21703  Py_INCREF(__pyx_d);
21704  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
21705  Py_INCREF(__pyx_b);
21706  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
21707  Py_INCREF(__pyx_cython_runtime);
21708  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21709  /*--- Initialize various global constants etc. ---*/
21710  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21711  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
21712  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21713  #endif
21714  if (__pyx_module_is_main_imate___c_trace_estimator__py_c_trace_estimator) {
21715  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21716  }
21717  #if PY_MAJOR_VERSION >= 3
21718  {
21719  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
21720  if (!PyDict_GetItemString(modules, "imate._c_trace_estimator.py_c_trace_estimator")) {
21721  if (unlikely(PyDict_SetItemString(modules, "imate._c_trace_estimator.py_c_trace_estimator", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21722  }
21723  }
21724  #endif
21725  /*--- Builtin init code ---*/
21726  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21727  /*--- Constants init code ---*/
21728  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21729  /*--- Global type/function init code ---*/
21730  (void)__Pyx_modinit_global_init_code();
21731  (void)__Pyx_modinit_variable_export_code();
21732  if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21733  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21734  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21735  (void)__Pyx_modinit_variable_import_code();
21736  if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21737  /*--- Execution code ---*/
21738  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
21739  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21740  #endif
21741  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
21742 
21743  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":15
21744  *
21745  * # Python
21746  * import numpy # <<<<<<<<<<<<<<
21747  *
21748  * # Cython
21749  */
21750  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
21751  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
21752  __Pyx_GOTREF(__pyx_t_1);
21753  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
21754  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21755 
21756  /* "imate/_c_trace_estimator/lapack_api.pxi":21
21757  * # ============
21758  *
21759  * cdef public void lapack_sstev(char* jobz, int* n, float* d, float* e, float* z, # <<<<<<<<<<<<<<
21760  * int* ldz, float* work, int* info) nogil:
21761  * """
21762  */
21763  __Pyx_TraceLine(21,0,__PYX_ERR(1, 21, __pyx_L1_error))
21764 
21765 
21766  /* "imate/_c_trace_estimator/lapack_api.pxi":41
21767  * # ============
21768  *
21769  * cdef public void lapack_dstev(char* jobz, int* n, double* d, double* e, # <<<<<<<<<<<<<<
21770  * double* z, int* ldz, double* work,
21771  * int* info) nogil:
21772  */
21773  __Pyx_TraceLine(41,0,__PYX_ERR(1, 41, __pyx_L1_error))
21774 
21775 
21776  /* "imate/_c_trace_estimator/lapack_api.pxi":62
21777  * # =============
21778  *
21779  * cdef public void lapack_sbdsdc(char* uplo, char* compq, int* n, float* d, # <<<<<<<<<<<<<<
21780  * float *e, float* u, int* ldu, float* vt,
21781  * int* ldvt, float* q, int* iq, float* work,
21782  */
21783  __Pyx_TraceLine(62,0,__PYX_ERR(1, 62, __pyx_L1_error))
21784 
21785 
21786  /* "imate/_c_trace_estimator/lapack_api.pxi":84
21787  * # =============
21788  *
21789  * cdef public void lapack_dbdsdc(char* uplo, char* compq, int* n, double* d, # <<<<<<<<<<<<<<
21790  * double *e, double* u, int* ldu, double* vt,
21791  * int* ldvt, double* q, int* iq, double* work,
21792  */
21793  __Pyx_TraceLine(84,0,__PYX_ERR(1, 84, __pyx_L1_error))
21794 
21795 
21796  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":38
21797  * # ===================
21798  *
21799  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
21800  * pycLinearOperator Aop,
21801  * parameters,
21802  */
21803  __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error))
21804 
21805  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator, 0, __pyx_n_s_pyc_trace_estimator, NULL, __pyx_n_s_imate__c_trace_estimator_py_c_tr_2, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
21806  __Pyx_GOTREF(__pyx_t_1);
21807  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyc_trace_estimator, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
21808  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21809 
21810  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":168
21811  * # =========================
21812  *
21813  * cdef FlagType _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
21814  * pycLinearOperator Aop,
21815  * parameters,
21816  */
21817  __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error))
21818 
21819 
21820  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":283
21821  * # ==========================
21822  *
21823  * cdef FlagType _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
21824  * pycLinearOperator Aop,
21825  * parameters,
21826  */
21827  __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
21828 
21829 
21830  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":398
21831  * # ===============================
21832  *
21833  * cdef FlagType _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
21834  * pycLinearOperator Aop,
21835  * parameters,
21836  */
21837  __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error))
21838 
21839 
21840  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":1
21841  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
21842  * # SPDX-License-Identifier: BSD-3-Clause
21843  * # SPDX-FileType: SOURCE
21844  */
21845  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
21846  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21847  __Pyx_GOTREF(__pyx_t_1);
21848  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21849  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21850 
21851  /* "View.MemoryView":210
21852  * info.obj = self
21853  *
21854  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
21855  *
21856  * def __dealloc__(array self):
21857  */
21858  __Pyx_TraceLine(210,0,__PYX_ERR(2, 210, __pyx_L1_error))
21859  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 210, __pyx_L1_error)
21860  __Pyx_GOTREF(__pyx_t_1);
21861  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 210, __pyx_L1_error)
21862  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21863  PyType_Modified(__pyx_array_type);
21864 
21865  /* "View.MemoryView":227
21866  *
21867  * @cname('get_memview')
21868  * cdef get_memview(self): # <<<<<<<<<<<<<<
21869  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
21870  * return memoryview(self, flags, self.dtype_is_object)
21871  */
21872  __Pyx_TraceLine(227,0,__PYX_ERR(2, 227, __pyx_L1_error))
21873 
21874 
21875  /* "View.MemoryView":245
21876  *
21877  * @cname("__pyx_array_new")
21878  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
21879  * char *mode, char *buf):
21880  * cdef array result
21881  */
21882  __Pyx_TraceLine(245,0,__PYX_ERR(2, 245, __pyx_L1_error))
21883 
21884 
21885  /* "View.MemoryView":287
21886  * return self.name
21887  *
21888  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21889  * cdef strided = Enum("<strided and direct>") # default
21890  * cdef indirect = Enum("<strided and indirect>")
21891  */
21892  __Pyx_TraceLine(287,0,__PYX_ERR(2, 287, __pyx_L1_error))
21893  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
21894  __Pyx_GOTREF(__pyx_t_1);
21895  __Pyx_XGOTREF(generic);
21896  __Pyx_DECREF_SET(generic, __pyx_t_1);
21897  __Pyx_GIVEREF(__pyx_t_1);
21898  __pyx_t_1 = 0;
21899 
21900  /* "View.MemoryView":288
21901  *
21902  * cdef generic = Enum("<strided and direct or indirect>")
21903  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21904  * cdef indirect = Enum("<strided and indirect>")
21905  *
21906  */
21907  __Pyx_TraceLine(288,0,__PYX_ERR(2, 288, __pyx_L1_error))
21908  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error)
21909  __Pyx_GOTREF(__pyx_t_1);
21910  __Pyx_XGOTREF(strided);
21911  __Pyx_DECREF_SET(strided, __pyx_t_1);
21912  __Pyx_GIVEREF(__pyx_t_1);
21913  __pyx_t_1 = 0;
21914 
21915  /* "View.MemoryView":289
21916  * cdef generic = Enum("<strided and direct or indirect>")
21917  * cdef strided = Enum("<strided and direct>") # default
21918  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21919  *
21920  *
21921  */
21922  __Pyx_TraceLine(289,0,__PYX_ERR(2, 289, __pyx_L1_error))
21923  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 289, __pyx_L1_error)
21924  __Pyx_GOTREF(__pyx_t_1);
21925  __Pyx_XGOTREF(indirect);
21926  __Pyx_DECREF_SET(indirect, __pyx_t_1);
21927  __Pyx_GIVEREF(__pyx_t_1);
21928  __pyx_t_1 = 0;
21929 
21930  /* "View.MemoryView":292
21931  *
21932  *
21933  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21934  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21935  *
21936  */
21937  __Pyx_TraceLine(292,0,__PYX_ERR(2, 292, __pyx_L1_error))
21938  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error)
21939  __Pyx_GOTREF(__pyx_t_1);
21940  __Pyx_XGOTREF(contiguous);
21941  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
21942  __Pyx_GIVEREF(__pyx_t_1);
21943  __pyx_t_1 = 0;
21944 
21945  /* "View.MemoryView":293
21946  *
21947  * cdef contiguous = Enum("<contiguous and direct>")
21948  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21949  *
21950  *
21951  */
21952  __Pyx_TraceLine(293,0,__PYX_ERR(2, 293, __pyx_L1_error))
21953  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error)
21954  __Pyx_GOTREF(__pyx_t_1);
21955  __Pyx_XGOTREF(indirect_contiguous);
21956  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
21957  __Pyx_GIVEREF(__pyx_t_1);
21958  __pyx_t_1 = 0;
21959 
21960  /* "View.MemoryView":299
21961  *
21962  * @cname('__pyx_align_pointer')
21963  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
21964  * "Align pointer memory on a given boundary"
21965  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
21966  */
21967  __Pyx_TraceLine(299,0,__PYX_ERR(2, 299, __pyx_L1_error))
21968 
21969 
21970  /* "View.MemoryView":317
21971  *
21972  * DEF THREAD_LOCKS_PREALLOCATED = 8
21973  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
21974  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
21975  * PyThread_allocate_lock(),
21976  */
21977  __Pyx_TraceLine(317,0,__PYX_ERR(2, 317, __pyx_L1_error))
21978  __pyx_memoryview_thread_locks_used = 0;
21979 
21980  /* "View.MemoryView":318
21981  * DEF THREAD_LOCKS_PREALLOCATED = 8
21982  * cdef int __pyx_memoryview_thread_locks_used = 0
21983  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
21984  * PyThread_allocate_lock(),
21985  * PyThread_allocate_lock(),
21986  */
21987  __Pyx_TraceLine(318,0,__PYX_ERR(2, 318, __pyx_L1_error))
21988  __pyx_t_2[0] = PyThread_allocate_lock();
21989  __pyx_t_2[1] = PyThread_allocate_lock();
21990  __pyx_t_2[2] = PyThread_allocate_lock();
21991  __pyx_t_2[3] = PyThread_allocate_lock();
21992  __pyx_t_2[4] = PyThread_allocate_lock();
21993  __pyx_t_2[5] = PyThread_allocate_lock();
21994  __pyx_t_2[6] = PyThread_allocate_lock();
21995  __pyx_t_2[7] = PyThread_allocate_lock();
21996  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
21997 
21998  /* "View.MemoryView":395
21999  * PyThread_free_lock(self.lock)
22000  *
22001  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
22002  * cdef Py_ssize_t dim
22003  * cdef char *itemp = <char *> self.view.buf
22004  */
22005  __Pyx_TraceLine(395,0,__PYX_ERR(2, 395, __pyx_L1_error))
22006 
22007 
22008  /* "View.MemoryView":433
22009  * self.setitem_indexed(index, value)
22010  *
22011  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
22012  * if not isinstance(obj, memoryview):
22013  * try:
22014  */
22015  __Pyx_TraceLine(433,0,__PYX_ERR(2, 433, __pyx_L1_error))
22016 
22017 
22018  /* "View.MemoryView":443
22019  * return obj
22020  *
22021  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
22022  * cdef __Pyx_memviewslice dst_slice
22023  * cdef __Pyx_memviewslice src_slice
22024  */
22025  __Pyx_TraceLine(443,0,__PYX_ERR(2, 443, __pyx_L1_error))
22026 
22027 
22028  /* "View.MemoryView":451
22029  * src.ndim, dst.ndim, self.dtype_is_object)
22030  *
22031  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
22032  * cdef int array[128]
22033  * cdef void *tmp = NULL
22034  */
22035  __Pyx_TraceLine(451,0,__PYX_ERR(2, 451, __pyx_L1_error))
22036 
22037 
22038  /* "View.MemoryView":483
22039  * PyMem_Free(tmp)
22040  *
22041  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
22042  * cdef char *itemp = self.get_item_pointer(index)
22043  * self.assign_item_from_object(itemp, value)
22044  */
22045  __Pyx_TraceLine(483,0,__PYX_ERR(2, 483, __pyx_L1_error))
22046 
22047 
22048  /* "View.MemoryView":487
22049  * self.assign_item_from_object(itemp, value)
22050  *
22051  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
22052  * """Only used if instantiated manually by the user, or if Cython doesn't
22053  * know how to convert the type"""
22054  */
22055  __Pyx_TraceLine(487,0,__PYX_ERR(2, 487, __pyx_L1_error))
22056 
22057 
22058  /* "View.MemoryView":503
22059  * return result
22060  *
22061  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
22062  * """Only used if instantiated manually by the user, or if Cython doesn't
22063  * know how to convert the type"""
22064  */
22065  __Pyx_TraceLine(503,0,__PYX_ERR(2, 503, __pyx_L1_error))
22066 
22067 
22068  /* "View.MemoryView":551
22069  * info.obj = self
22070  *
22071  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22072  *
22073  *
22074  */
22075  __Pyx_TraceLine(551,0,__PYX_ERR(2, 551, __pyx_L1_error))
22076  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 551, __pyx_L1_error)
22077  __Pyx_GOTREF(__pyx_t_1);
22078  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 551, __pyx_L1_error)
22079  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22080  PyType_Modified(__pyx_memoryview_type);
22081 
22082  /* "View.MemoryView":659
22083  *
22084  * @cname('__pyx_memoryview_new')
22085  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
22086  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
22087  * result.typeinfo = typeinfo
22088  */
22089  __Pyx_TraceLine(659,0,__PYX_ERR(2, 659, __pyx_L1_error))
22090 
22091 
22092  /* "View.MemoryView":665
22093  *
22094  * @cname('__pyx_memoryview_check')
22095  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
22096  * return isinstance(o, memoryview)
22097  *
22098  */
22099  __Pyx_TraceLine(665,0,__PYX_ERR(2, 665, __pyx_L1_error))
22100 
22101 
22102  /* "View.MemoryView":668
22103  * return isinstance(o, memoryview)
22104  *
22105  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
22106  * """
22107  * Replace all ellipses with full slices and fill incomplete indices with
22108  */
22109  __Pyx_TraceLine(668,0,__PYX_ERR(2, 668, __pyx_L1_error))
22110 
22111 
22112  /* "View.MemoryView":702
22113  * return have_slices or nslices, tuple(result)
22114  *
22115  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
22116  * for suboffset in suboffsets[:ndim]:
22117  * if suboffset >= 0:
22118  */
22119  __Pyx_TraceLine(702,0,__PYX_ERR(2, 702, __pyx_L1_error))
22120 
22121 
22122  /* "View.MemoryView":712
22123  *
22124  * @cname('__pyx_memview_slice')
22125  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
22126  * cdef int new_ndim = 0, suboffset_dim = -1, dim
22127  * cdef bint negative_step
22128  */
22129  __Pyx_TraceLine(712,0,__PYX_ERR(2, 712, __pyx_L1_error))
22130 
22131 
22132  /* "View.MemoryView":809
22133  *
22134  * @cname('__pyx_memoryview_slice_memviewslice')
22135  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
22136  * __Pyx_memviewslice *dst,
22137  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
22138  */
22139  __Pyx_TraceLine(809,0,__PYX_ERR(2, 809, __pyx_L1_error))
22140 
22141 
22142  /* "View.MemoryView":912
22143  *
22144  * @cname('__pyx_pybuffer_index')
22145  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
22146  * Py_ssize_t dim) except NULL:
22147  * cdef Py_ssize_t shape, stride, suboffset = -1
22148  */
22149  __Pyx_TraceLine(912,0,__PYX_ERR(2, 912, __pyx_L1_error))
22150 
22151 
22152  /* "View.MemoryView":945
22153  *
22154  * @cname('__pyx_memslice_transpose')
22155  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
22156  * cdef int ndim = memslice.memview.view.ndim
22157  *
22158  */
22159  __Pyx_TraceLine(945,0,__PYX_ERR(2, 945, __pyx_L1_error))
22160 
22161 
22162  /* "View.MemoryView":981
22163  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
22164  *
22165  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
22166  * if self.to_object_func != NULL:
22167  * return self.to_object_func(itemp)
22168  */
22169  __Pyx_TraceLine(981,0,__PYX_ERR(2, 981, __pyx_L1_error))
22170 
22171 
22172  /* "View.MemoryView":987
22173  * return memoryview.convert_item_to_object(self, itemp)
22174  *
22175  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
22176  * if self.to_dtype_func != NULL:
22177  * self.to_dtype_func(itemp, value)
22178  */
22179  __Pyx_TraceLine(987,0,__PYX_ERR(2, 987, __pyx_L1_error))
22180 
22181 
22182  /* "View.MemoryView":997
22183  * return self.from_object
22184  *
22185  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22186  *
22187  *
22188  */
22189  __Pyx_TraceLine(997,0,__PYX_ERR(2, 997, __pyx_L1_error))
22190  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 997, __pyx_L1_error)
22191  __Pyx_GOTREF(__pyx_t_1);
22192  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 997, __pyx_L1_error)
22193  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22194  PyType_Modified(__pyx_memoryviewslice_type);
22195 
22196  /* "View.MemoryView":1001
22197  *
22198  * @cname('__pyx_memoryview_fromslice')
22199  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
22200  * int ndim,
22201  * object (*to_object_func)(char *),
22202  */
22203  __Pyx_TraceLine(1001,0,__PYX_ERR(2, 1001, __pyx_L1_error))
22204 
22205 
22206  /* "View.MemoryView":1054
22207  *
22208  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22209  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
22210  * __Pyx_memviewslice *mslice) except NULL:
22211  * cdef _memoryviewslice obj
22212  */
22213  __Pyx_TraceLine(1054,0,__PYX_ERR(2, 1054, __pyx_L1_error))
22214 
22215 
22216  /* "View.MemoryView":1065
22217  *
22218  * @cname('__pyx_memoryview_slice_copy')
22219  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
22220  * cdef int dim
22221  * cdef (Py_ssize_t*) shape, strides, suboffsets
22222  */
22223  __Pyx_TraceLine(1065,0,__PYX_ERR(2, 1065, __pyx_L1_error))
22224 
22225 
22226  /* "View.MemoryView":1082
22227  *
22228  * @cname('__pyx_memoryview_copy_object')
22229  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
22230  * "Create a new memoryview object"
22231  * cdef __Pyx_memviewslice memviewslice
22232  */
22233  __Pyx_TraceLine(1082,0,__PYX_ERR(2, 1082, __pyx_L1_error))
22234 
22235 
22236  /* "View.MemoryView":1089
22237  *
22238  * @cname('__pyx_memoryview_copy_object_from_slice')
22239  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
22240  * """
22241  * Create a new memoryview object from a given memoryview object and slice.
22242  */
22243  __Pyx_TraceLine(1089,0,__PYX_ERR(2, 1089, __pyx_L1_error))
22244 
22245 
22246  /* "View.MemoryView":1111
22247  *
22248  *
22249  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
22250  * if arg < 0:
22251  * return -arg
22252  */
22253  __Pyx_TraceLine(1111,0,__PYX_ERR(2, 1111, __pyx_L1_error))
22254 
22255 
22256  /* "View.MemoryView":1118
22257  *
22258  * @cname('__pyx_get_best_slice_order')
22259  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
22260  * """
22261  * Figure out the best memory access order for a given slice.
22262  */
22263  __Pyx_TraceLine(1118,0,__PYX_ERR(2, 1118, __pyx_L1_error))
22264 
22265 
22266  /* "View.MemoryView":1172
22267  * dst_data += dst_stride
22268  *
22269  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
22270  * __Pyx_memviewslice *dst,
22271  * int ndim, size_t itemsize) nogil:
22272  */
22273  __Pyx_TraceLine(1172,0,__PYX_ERR(2, 1172, __pyx_L1_error))
22274 
22275 
22276  /* "View.MemoryView":1179
22277  *
22278  * @cname('__pyx_memoryview_slice_get_size')
22279  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
22280  * "Return the size of the memory occupied by the slice in number of bytes"
22281  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
22282  */
22283  __Pyx_TraceLine(1179,0,__PYX_ERR(2, 1179, __pyx_L1_error))
22284 
22285 
22286  /* "View.MemoryView":1189
22287  *
22288  * @cname('__pyx_fill_contig_strides_array')
22289  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
22290  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
22291  * int ndim, char order) nogil:
22292  */
22293  __Pyx_TraceLine(1189,0,__PYX_ERR(2, 1189, __pyx_L1_error))
22294 
22295 
22296  /* "View.MemoryView":1210
22297  *
22298  * @cname('__pyx_memoryview_copy_data_to_temp')
22299  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
22300  * __Pyx_memviewslice *tmpslice,
22301  * char order,
22302  */
22303  __Pyx_TraceLine(1210,0,__PYX_ERR(2, 1210, __pyx_L1_error))
22304 
22305 
22306  /* "View.MemoryView":1253
22307  *
22308  * @cname('__pyx_memoryview_err_extents')
22309  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
22310  * Py_ssize_t extent2) except -1 with gil:
22311  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
22312  */
22313  __Pyx_TraceLine(1253,0,__PYX_ERR(2, 1253, __pyx_L1_error))
22314 
22315 
22316  /* "View.MemoryView":1259
22317  *
22318  * @cname('__pyx_memoryview_err_dim')
22319  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
22320  * raise error(msg.decode('ascii') % dim)
22321  *
22322  */
22323  __Pyx_TraceLine(1259,0,__PYX_ERR(2, 1259, __pyx_L1_error))
22324 
22325 
22326  /* "View.MemoryView":1263
22327  *
22328  * @cname('__pyx_memoryview_err')
22329  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
22330  * if msg != NULL:
22331  * raise error(msg.decode('ascii'))
22332  */
22333  __Pyx_TraceLine(1263,0,__PYX_ERR(2, 1263, __pyx_L1_error))
22334 
22335 
22336  /* "View.MemoryView":1270
22337  *
22338  * @cname('__pyx_memoryview_copy_contents')
22339  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
22340  * __Pyx_memviewslice dst,
22341  * int src_ndim, int dst_ndim,
22342  */
22343  __Pyx_TraceLine(1270,0,__PYX_ERR(2, 1270, __pyx_L1_error))
22344 
22345 
22346  /* "View.MemoryView":1342
22347  *
22348  * @cname('__pyx_memoryview_broadcast_leading')
22349  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
22350  * int ndim,
22351  * int ndim_other) nogil:
22352  */
22353  __Pyx_TraceLine(1342,0,__PYX_ERR(2, 1342, __pyx_L1_error))
22354 
22355 
22356  /* "View.MemoryView":1364
22357  *
22358  * @cname('__pyx_memoryview_refcount_copying')
22359  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
22360  * int ndim, bint inc) nogil:
22361  *
22362  */
22363  __Pyx_TraceLine(1364,0,__PYX_ERR(2, 1364, __pyx_L1_error))
22364 
22365 
22366  /* "View.MemoryView":1373
22367  *
22368  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
22369  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
22370  * Py_ssize_t *strides, int ndim,
22371  * bint inc) with gil:
22372  */
22373  __Pyx_TraceLine(1373,0,__PYX_ERR(2, 1373, __pyx_L1_error))
22374 
22375 
22376  /* "View.MemoryView":1379
22377  *
22378  * @cname('__pyx_memoryview_refcount_objects_in_slice')
22379  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
22380  * Py_ssize_t *strides, int ndim, bint inc):
22381  * cdef Py_ssize_t i
22382  */
22383  __Pyx_TraceLine(1379,0,__PYX_ERR(2, 1379, __pyx_L1_error))
22384 
22385 
22386  /* "View.MemoryView":1399
22387  *
22388  * @cname('__pyx_memoryview_slice_assign_scalar')
22389  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
22390  * size_t itemsize, void *item,
22391  * bint dtype_is_object) nogil:
22392  */
22393  __Pyx_TraceLine(1399,0,__PYX_ERR(2, 1399, __pyx_L1_error))
22394 
22395 
22396  /* "View.MemoryView":1409
22397  *
22398  * @cname('__pyx_memoryview__slice_assign_scalar')
22399  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
22400  * Py_ssize_t *strides, int ndim,
22401  * size_t itemsize, void *item) nogil:
22402  */
22403  __Pyx_TraceLine(1409,0,__PYX_ERR(2, 1409, __pyx_L1_error))
22404 
22405 
22406  /* "(tree fragment)":1
22407  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22408  * cdef object __pyx_PickleError
22409  * cdef object __pyx_result
22410  */
22411  __Pyx_TraceLine(1,0,__PYX_ERR(2, 1, __pyx_L1_error))
22412  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
22413  __Pyx_GOTREF(__pyx_t_1);
22414  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
22415  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22416 
22417  /* "(tree fragment)":11
22418  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22419  * return __pyx_result
22420  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
22421  * __pyx_result.name = __pyx_state[0]
22422  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22423  */
22424  __Pyx_TraceLine(11,0,__PYX_ERR(2, 11, __pyx_L1_error))
22425 
22426  __Pyx_TraceReturn(Py_None, 0);
22427 
22428  /*--- Wrapped vars code ---*/
22429 
22430  goto __pyx_L0;
22431  __pyx_L1_error:;
22432  __Pyx_XDECREF(__pyx_t_1);
22433  if (__pyx_m) {
22434  if (__pyx_d) {
22435  __Pyx_AddTraceback("init imate._c_trace_estimator.py_c_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
22436  }
22437  Py_CLEAR(__pyx_m);
22438  } else if (!PyErr_Occurred()) {
22439  PyErr_SetString(PyExc_ImportError, "init imate._c_trace_estimator.py_c_trace_estimator");
22440  }
22441  __pyx_L0:;
22442  __Pyx_RefNannyFinishContext();
22443  #if CYTHON_PEP489_MULTI_PHASE_INIT
22444  return (__pyx_m != NULL) ? 0 : -1;
22445  #elif PY_MAJOR_VERSION >= 3
22446  return __pyx_m;
22447  #else
22448  return;
22449  #endif
22450 }
22451 
22452 /* --- Runtime support code --- */
22453 /* Refnanny */
22454 #if CYTHON_REFNANNY
22455 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
22456  PyObject *m = NULL, *p = NULL;
22457  void *r = NULL;
22458  m = PyImport_ImportModule(modname);
22459  if (!m) goto end;
22460  p = PyObject_GetAttrString(m, "RefNannyAPI");
22461  if (!p) goto end;
22462  r = PyLong_AsVoidPtr(p);
22463 end:
22464  Py_XDECREF(p);
22465  Py_XDECREF(m);
22466  return (__Pyx_RefNannyAPIStruct *)r;
22467 }
22468 #endif
22469 
22470 /* PyObjectGetAttrStr */
22471 #if CYTHON_USE_TYPE_SLOTS
22472 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
22473  PyTypeObject* tp = Py_TYPE(obj);
22474  if (likely(tp->tp_getattro))
22475  return tp->tp_getattro(obj, attr_name);
22476 #if PY_MAJOR_VERSION < 3
22477  if (likely(tp->tp_getattr))
22478  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
22479 #endif
22480  return PyObject_GetAttr(obj, attr_name);
22481 }
22482 #endif
22483 
22484 /* GetBuiltinName */
22485 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
22486  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
22487  if (unlikely(!result)) {
22488  PyErr_Format(PyExc_NameError,
22489 #if PY_MAJOR_VERSION >= 3
22490  "name '%U' is not defined", name);
22491 #else
22492  "name '%.200s' is not defined", PyString_AS_STRING(name));
22493 #endif
22494  }
22495  return result;
22496 }
22497 
22498 /* PyErrFetchRestore */
22499 #if CYTHON_FAST_THREAD_STATE
22500 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22501  PyObject *tmp_type, *tmp_value, *tmp_tb;
22502  tmp_type = tstate->curexc_type;
22503  tmp_value = tstate->curexc_value;
22504  tmp_tb = tstate->curexc_traceback;
22505  tstate->curexc_type = type;
22506  tstate->curexc_value = value;
22507  tstate->curexc_traceback = tb;
22508  Py_XDECREF(tmp_type);
22509  Py_XDECREF(tmp_value);
22510  Py_XDECREF(tmp_tb);
22511 }
22512 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22513  *type = tstate->curexc_type;
22514  *value = tstate->curexc_value;
22515  *tb = tstate->curexc_traceback;
22516  tstate->curexc_type = 0;
22517  tstate->curexc_value = 0;
22518  tstate->curexc_traceback = 0;
22519 }
22520 #endif
22521 
22522 /* Profile */
22523 #if CYTHON_PROFILE
22524 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
22525  PyFrameObject** frame,
22526  PyThreadState* tstate,
22527  const char *funcname,
22528  const char *srcfile,
22529  int firstlineno) {
22530  PyObject *type, *value, *traceback;
22531  int retval;
22532  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
22533  if (*code == NULL) {
22534  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
22535  if (*code == NULL) return 0;
22536  }
22537  *frame = PyFrame_New(
22538  tstate, /*PyThreadState *tstate*/
22539  *code, /*PyCodeObject *code*/
22540  __pyx_d, /*PyObject *globals*/
22541  0 /*PyObject *locals*/
22542  );
22543  if (*frame == NULL) return 0;
22544  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
22545  Py_INCREF(Py_None);
22546  (*frame)->f_trace = Py_None;
22547  }
22548 #if PY_VERSION_HEX < 0x030400B1
22549  } else {
22550  (*frame)->f_tstate = tstate;
22551 #endif
22552  }
22553  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
22554  retval = 1;
22555  __Pyx_EnterTracing(tstate);
22556  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
22557  #if CYTHON_TRACE
22558  if (tstate->c_tracefunc)
22559  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
22560  if (retval && tstate->c_profilefunc)
22561  #endif
22562  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
22563  __Pyx_LeaveTracing(tstate);
22564  if (retval) {
22565  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
22566  return __Pyx_IsTracing(tstate, 0, 0) && retval;
22567  } else {
22568  Py_XDECREF(type);
22569  Py_XDECREF(value);
22570  Py_XDECREF(traceback);
22571  return -1;
22572  }
22573 }
22574 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
22575  PyCodeObject *py_code = 0;
22576 #if PY_MAJOR_VERSION >= 3
22577  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
22578  if (likely(py_code)) {
22579  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
22580  }
22581 #else
22582  PyObject *py_srcfile = 0;
22583  PyObject *py_funcname = 0;
22584  py_funcname = PyString_FromString(funcname);
22585  if (unlikely(!py_funcname)) goto bad;
22586  py_srcfile = PyString_FromString(srcfile);
22587  if (unlikely(!py_srcfile)) goto bad;
22588  py_code = PyCode_New(
22589  0,
22590  0,
22591  0,
22592  CO_OPTIMIZED | CO_NEWLOCALS,
22593  __pyx_empty_bytes, /*PyObject *code,*/
22594  __pyx_empty_tuple, /*PyObject *consts,*/
22595  __pyx_empty_tuple, /*PyObject *names,*/
22596  __pyx_empty_tuple, /*PyObject *varnames,*/
22597  __pyx_empty_tuple, /*PyObject *freevars,*/
22598  __pyx_empty_tuple, /*PyObject *cellvars,*/
22599  py_srcfile, /*PyObject *filename,*/
22600  py_funcname, /*PyObject *name,*/
22601  firstlineno,
22602  __pyx_empty_bytes /*PyObject *lnotab*/
22603  );
22604 bad:
22605  Py_XDECREF(py_srcfile);
22606  Py_XDECREF(py_funcname);
22607 #endif
22608  return py_code;
22609 }
22610 #endif
22611 
22612 /* WriteUnraisableException */
22613 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
22614  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
22615  int full_traceback, CYTHON_UNUSED int nogil) {
22616  PyObject *old_exc, *old_val, *old_tb;
22617  PyObject *ctx;
22618  __Pyx_PyThreadState_declare
22619 #ifdef WITH_THREAD
22620  PyGILState_STATE state;
22621  if (nogil)
22622  state = PyGILState_Ensure();
22623  else state = (PyGILState_STATE)0;
22624 #endif
22625  __Pyx_PyThreadState_assign
22626  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
22627  if (full_traceback) {
22628  Py_XINCREF(old_exc);
22629  Py_XINCREF(old_val);
22630  Py_XINCREF(old_tb);
22631  __Pyx_ErrRestore(old_exc, old_val, old_tb);
22632  PyErr_PrintEx(1);
22633  }
22634  #if PY_MAJOR_VERSION < 3
22635  ctx = PyString_FromString(name);
22636  #else
22637  ctx = PyUnicode_FromString(name);
22638  #endif
22639  __Pyx_ErrRestore(old_exc, old_val, old_tb);
22640  if (!ctx) {
22641  PyErr_WriteUnraisable(Py_None);
22642  } else {
22643  PyErr_WriteUnraisable(ctx);
22644  Py_DECREF(ctx);
22645  }
22646 #ifdef WITH_THREAD
22647  if (nogil)
22648  PyGILState_Release(state);
22649 #endif
22650 }
22651 
22652 /* BytesEquals */
22653 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
22654 #if CYTHON_COMPILING_IN_PYPY
22655  return PyObject_RichCompareBool(s1, s2, equals);
22656 #else
22657  if (s1 == s2) {
22658  return (equals == Py_EQ);
22659  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22660  const char *ps1, *ps2;
22661  Py_ssize_t length = PyBytes_GET_SIZE(s1);
22662  if (length != PyBytes_GET_SIZE(s2))
22663  return (equals == Py_NE);
22664  ps1 = PyBytes_AS_STRING(s1);
22665  ps2 = PyBytes_AS_STRING(s2);
22666  if (ps1[0] != ps2[0]) {
22667  return (equals == Py_NE);
22668  } else if (length == 1) {
22669  return (equals == Py_EQ);
22670  } else {
22671  int result;
22672 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
22673  Py_hash_t hash1, hash2;
22674  hash1 = ((PyBytesObject*)s1)->ob_shash;
22675  hash2 = ((PyBytesObject*)s2)->ob_shash;
22676  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22677  return (equals == Py_NE);
22678  }
22679 #endif
22680  result = memcmp(ps1, ps2, (size_t)length);
22681  return (equals == Py_EQ) ? (result == 0) : (result != 0);
22682  }
22683  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22684  return (equals == Py_NE);
22685  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22686  return (equals == Py_NE);
22687  } else {
22688  int result;
22689  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22690  if (!py_result)
22691  return -1;
22692  result = __Pyx_PyObject_IsTrue(py_result);
22693  Py_DECREF(py_result);
22694  return result;
22695  }
22696 #endif
22697 }
22698 
22699 /* MemviewSliceInit */
22700 static int
22701 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
22702  int ndim,
22703  __Pyx_memviewslice *memviewslice,
22704  int memview_is_new_reference)
22705 {
22706  __Pyx_RefNannyDeclarations
22707  int i, retval=-1;
22708  Py_buffer *buf = &memview->view;
22709  __Pyx_RefNannySetupContext("init_memviewslice", 0);
22710  if (unlikely(memviewslice->memview || memviewslice->data)) {
22711  PyErr_SetString(PyExc_ValueError,
22712  "memviewslice is already initialized!");
22713  goto fail;
22714  }
22715  if (buf->strides) {
22716  for (i = 0; i < ndim; i++) {
22717  memviewslice->strides[i] = buf->strides[i];
22718  }
22719  } else {
22720  Py_ssize_t stride = buf->itemsize;
22721  for (i = ndim - 1; i >= 0; i--) {
22722  memviewslice->strides[i] = stride;
22723  stride *= buf->shape[i];
22724  }
22725  }
22726  for (i = 0; i < ndim; i++) {
22727  memviewslice->shape[i] = buf->shape[i];
22728  if (buf->suboffsets) {
22729  memviewslice->suboffsets[i] = buf->suboffsets[i];
22730  } else {
22731  memviewslice->suboffsets[i] = -1;
22732  }
22733  }
22734  memviewslice->memview = memview;
22735  memviewslice->data = (char *)buf->buf;
22736  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
22737  Py_INCREF(memview);
22738  }
22739  retval = 0;
22740  goto no_fail;
22741 fail:
22742  memviewslice->memview = 0;
22743  memviewslice->data = 0;
22744  retval = -1;
22745 no_fail:
22746  __Pyx_RefNannyFinishContext();
22747  return retval;
22748 }
22749 #ifndef Py_NO_RETURN
22750 #define Py_NO_RETURN
22751 #endif
22752 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
22753  va_list vargs;
22754  char msg[200];
22755 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
22756  va_start(vargs, fmt);
22757 #else
22758  va_start(vargs);
22759 #endif
22760  vsnprintf(msg, 200, fmt, vargs);
22761  va_end(vargs);
22762  Py_FatalError(msg);
22763 }
22764 static CYTHON_INLINE int
22765 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22766  PyThread_type_lock lock)
22767 {
22768  int result;
22769  PyThread_acquire_lock(lock, 1);
22770  result = (*acquisition_count)++;
22771  PyThread_release_lock(lock);
22772  return result;
22773 }
22774 static CYTHON_INLINE int
22775 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22776  PyThread_type_lock lock)
22777 {
22778  int result;
22779  PyThread_acquire_lock(lock, 1);
22780  result = (*acquisition_count)--;
22781  PyThread_release_lock(lock);
22782  return result;
22783 }
22784 static CYTHON_INLINE void
22785 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
22786 {
22787  int first_time;
22788  struct __pyx_memoryview_obj *memview = memslice->memview;
22789  if (unlikely(!memview || (PyObject *) memview == Py_None))
22790  return;
22791  if (unlikely(__pyx_get_slice_count(memview) < 0))
22792  __pyx_fatalerror("Acquisition count is %d (line %d)",
22793  __pyx_get_slice_count(memview), lineno);
22794  first_time = __pyx_add_acquisition_count(memview) == 0;
22795  if (unlikely(first_time)) {
22796  if (have_gil) {
22797  Py_INCREF((PyObject *) memview);
22798  } else {
22799  PyGILState_STATE _gilstate = PyGILState_Ensure();
22800  Py_INCREF((PyObject *) memview);
22801  PyGILState_Release(_gilstate);
22802  }
22803  }
22804 }
22805 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
22806  int have_gil, int lineno) {
22807  int last_time;
22808  struct __pyx_memoryview_obj *memview = memslice->memview;
22809  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
22810  memslice->memview = NULL;
22811  return;
22812  }
22813  if (unlikely(__pyx_get_slice_count(memview) <= 0))
22814  __pyx_fatalerror("Acquisition count is %d (line %d)",
22815  __pyx_get_slice_count(memview), lineno);
22816  last_time = __pyx_sub_acquisition_count(memview) == 1;
22817  memslice->data = NULL;
22818  if (unlikely(last_time)) {
22819  if (have_gil) {
22820  Py_CLEAR(memslice->memview);
22821  } else {
22822  PyGILState_STATE _gilstate = PyGILState_Ensure();
22823  Py_CLEAR(memslice->memview);
22824  PyGILState_Release(_gilstate);
22825  }
22826  } else {
22827  memslice->memview = NULL;
22828  }
22829 }
22830 
22831 /* PyObjectCall */
22832 #if CYTHON_COMPILING_IN_CPYTHON
22833 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22834  PyObject *result;
22835  ternaryfunc call = Py_TYPE(func)->tp_call;
22836  if (unlikely(!call))
22837  return PyObject_Call(func, arg, kw);
22838  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22839  return NULL;
22840  result = (*call)(func, arg, kw);
22841  Py_LeaveRecursiveCall();
22842  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22843  PyErr_SetString(
22844  PyExc_SystemError,
22845  "NULL result without error in PyObject_Call");
22846  }
22847  return result;
22848 }
22849 #endif
22850 
22851 /* RaiseException */
22852 #if PY_MAJOR_VERSION < 3
22853 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22854  CYTHON_UNUSED PyObject *cause) {
22855  __Pyx_PyThreadState_declare
22856  Py_XINCREF(type);
22857  if (!value || value == Py_None)
22858  value = NULL;
22859  else
22860  Py_INCREF(value);
22861  if (!tb || tb == Py_None)
22862  tb = NULL;
22863  else {
22864  Py_INCREF(tb);
22865  if (!PyTraceBack_Check(tb)) {
22866  PyErr_SetString(PyExc_TypeError,
22867  "raise: arg 3 must be a traceback or None");
22868  goto raise_error;
22869  }
22870  }
22871  if (PyType_Check(type)) {
22872 #if CYTHON_COMPILING_IN_PYPY
22873  if (!value) {
22874  Py_INCREF(Py_None);
22875  value = Py_None;
22876  }
22877 #endif
22878  PyErr_NormalizeException(&type, &value, &tb);
22879  } else {
22880  if (value) {
22881  PyErr_SetString(PyExc_TypeError,
22882  "instance exception may not have a separate value");
22883  goto raise_error;
22884  }
22885  value = type;
22886  type = (PyObject*) Py_TYPE(type);
22887  Py_INCREF(type);
22888  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
22889  PyErr_SetString(PyExc_TypeError,
22890  "raise: exception class must be a subclass of BaseException");
22891  goto raise_error;
22892  }
22893  }
22894  __Pyx_PyThreadState_assign
22895  __Pyx_ErrRestore(type, value, tb);
22896  return;
22897 raise_error:
22898  Py_XDECREF(value);
22899  Py_XDECREF(type);
22900  Py_XDECREF(tb);
22901  return;
22902 }
22903 #else
22904 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
22905  PyObject* owned_instance = NULL;
22906  if (tb == Py_None) {
22907  tb = 0;
22908  } else if (tb && !PyTraceBack_Check(tb)) {
22909  PyErr_SetString(PyExc_TypeError,
22910  "raise: arg 3 must be a traceback or None");
22911  goto bad;
22912  }
22913  if (value == Py_None)
22914  value = 0;
22915  if (PyExceptionInstance_Check(type)) {
22916  if (value) {
22917  PyErr_SetString(PyExc_TypeError,
22918  "instance exception may not have a separate value");
22919  goto bad;
22920  }
22921  value = type;
22922  type = (PyObject*) Py_TYPE(value);
22923  } else if (PyExceptionClass_Check(type)) {
22924  PyObject *instance_class = NULL;
22925  if (value && PyExceptionInstance_Check(value)) {
22926  instance_class = (PyObject*) Py_TYPE(value);
22927  if (instance_class != type) {
22928  int is_subclass = PyObject_IsSubclass(instance_class, type);
22929  if (!is_subclass) {
22930  instance_class = NULL;
22931  } else if (unlikely(is_subclass == -1)) {
22932  goto bad;
22933  } else {
22934  type = instance_class;
22935  }
22936  }
22937  }
22938  if (!instance_class) {
22939  PyObject *args;
22940  if (!value)
22941  args = PyTuple_New(0);
22942  else if (PyTuple_Check(value)) {
22943  Py_INCREF(value);
22944  args = value;
22945  } else
22946  args = PyTuple_Pack(1, value);
22947  if (!args)
22948  goto bad;
22949  owned_instance = PyObject_Call(type, args, NULL);
22950  Py_DECREF(args);
22951  if (!owned_instance)
22952  goto bad;
22953  value = owned_instance;
22954  if (!PyExceptionInstance_Check(value)) {
22955  PyErr_Format(PyExc_TypeError,
22956  "calling %R should have returned an instance of "
22957  "BaseException, not %R",
22958  type, Py_TYPE(value));
22959  goto bad;
22960  }
22961  }
22962  } else {
22963  PyErr_SetString(PyExc_TypeError,
22964  "raise: exception class must be a subclass of BaseException");
22965  goto bad;
22966  }
22967  if (cause) {
22968  PyObject *fixed_cause;
22969  if (cause == Py_None) {
22970  fixed_cause = NULL;
22971  } else if (PyExceptionClass_Check(cause)) {
22972  fixed_cause = PyObject_CallObject(cause, NULL);
22973  if (fixed_cause == NULL)
22974  goto bad;
22975  } else if (PyExceptionInstance_Check(cause)) {
22976  fixed_cause = cause;
22977  Py_INCREF(fixed_cause);
22978  } else {
22979  PyErr_SetString(PyExc_TypeError,
22980  "exception causes must derive from "
22981  "BaseException");
22982  goto bad;
22983  }
22984  PyException_SetCause(value, fixed_cause);
22985  }
22986  PyErr_SetObject(type, value);
22987  if (tb) {
22988 #if CYTHON_FAST_THREAD_STATE
22989  PyThreadState *tstate = __Pyx_PyThreadState_Current;
22990  PyObject* tmp_tb = tstate->curexc_traceback;
22991  if (tb != tmp_tb) {
22992  Py_INCREF(tb);
22993  tstate->curexc_traceback = tb;
22994  Py_XDECREF(tmp_tb);
22995  }
22996 #else
22997  PyObject *tmp_type, *tmp_value, *tmp_tb;
22998  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
22999  Py_INCREF(tb);
23000  PyErr_Restore(tmp_type, tmp_value, tb);
23001  Py_XDECREF(tmp_tb);
23002 #endif
23003  }
23004 bad:
23005  Py_XDECREF(owned_instance);
23006  return;
23007 }
23008 #endif
23009 
23010 /* SetItemInt */
23011 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
23012  int r;
23013  if (!j) return -1;
23014  r = PyObject_SetItem(o, j, v);
23015  Py_DECREF(j);
23016  return r;
23017 }
23018 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
23019  CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
23020 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23021  if (is_list || PyList_CheckExact(o)) {
23022  Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
23023  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
23024  PyObject* old = PyList_GET_ITEM(o, n);
23025  Py_INCREF(v);
23026  PyList_SET_ITEM(o, n, v);
23027  Py_DECREF(old);
23028  return 1;
23029  }
23030  } else {
23031  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23032  if (likely(m && m->sq_ass_item)) {
23033  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23034  Py_ssize_t l = m->sq_length(o);
23035  if (likely(l >= 0)) {
23036  i += l;
23037  } else {
23038  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23039  return -1;
23040  PyErr_Clear();
23041  }
23042  }
23043  return m->sq_ass_item(o, i, v);
23044  }
23045  }
23046 #else
23047 #if CYTHON_COMPILING_IN_PYPY
23048  if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
23049 #else
23050  if (is_list || PySequence_Check(o))
23051 #endif
23052  {
23053  return PySequence_SetItem(o, i, v);
23054  }
23055 #endif
23056  return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
23057 }
23058 
23059 /* RaiseArgTupleInvalid */
23060 static void __Pyx_RaiseArgtupleInvalid(
23061  const char* func_name,
23062  int exact,
23063  Py_ssize_t num_min,
23064  Py_ssize_t num_max,
23065  Py_ssize_t num_found)
23066 {
23067  Py_ssize_t num_expected;
23068  const char *more_or_less;
23069  if (num_found < num_min) {
23070  num_expected = num_min;
23071  more_or_less = "at least";
23072  } else {
23073  num_expected = num_max;
23074  more_or_less = "at most";
23075  }
23076  if (exact) {
23077  more_or_less = "exactly";
23078  }
23079  PyErr_Format(PyExc_TypeError,
23080  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23081  func_name, more_or_less, num_expected,
23082  (num_expected == 1) ? "" : "s", num_found);
23083 }
23084 
23085 /* RaiseDoubleKeywords */
23086 static void __Pyx_RaiseDoubleKeywordsError(
23087  const char* func_name,
23088  PyObject* kw_name)
23089 {
23090  PyErr_Format(PyExc_TypeError,
23091  #if PY_MAJOR_VERSION >= 3
23092  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23093  #else
23094  "%s() got multiple values for keyword argument '%s'", func_name,
23095  PyString_AsString(kw_name));
23096  #endif
23097 }
23098 
23099 /* ParseKeywords */
23100 static int __Pyx_ParseOptionalKeywords(
23101  PyObject *kwds,
23102  PyObject **argnames[],
23103  PyObject *kwds2,
23104  PyObject *values[],
23105  Py_ssize_t num_pos_args,
23106  const char* function_name)
23107 {
23108  PyObject *key = 0, *value = 0;
23109  Py_ssize_t pos = 0;
23110  PyObject*** name;
23111  PyObject*** first_kw_arg = argnames + num_pos_args;
23112  while (PyDict_Next(kwds, &pos, &key, &value)) {
23113  name = first_kw_arg;
23114  while (*name && (**name != key)) name++;
23115  if (*name) {
23116  values[name-argnames] = value;
23117  continue;
23118  }
23119  name = first_kw_arg;
23120  #if PY_MAJOR_VERSION < 3
23121  if (likely(PyString_Check(key))) {
23122  while (*name) {
23123  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23124  && _PyString_Eq(**name, key)) {
23125  values[name-argnames] = value;
23126  break;
23127  }
23128  name++;
23129  }
23130  if (*name) continue;
23131  else {
23132  PyObject*** argname = argnames;
23133  while (argname != first_kw_arg) {
23134  if ((**argname == key) || (
23135  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23136  && _PyString_Eq(**argname, key))) {
23137  goto arg_passed_twice;
23138  }
23139  argname++;
23140  }
23141  }
23142  } else
23143  #endif
23144  if (likely(PyUnicode_Check(key))) {
23145  while (*name) {
23146  int cmp = (**name == key) ? 0 :
23147  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23148  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23149  #endif
23150  PyUnicode_Compare(**name, key);
23151  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23152  if (cmp == 0) {
23153  values[name-argnames] = value;
23154  break;
23155  }
23156  name++;
23157  }
23158  if (*name) continue;
23159  else {
23160  PyObject*** argname = argnames;
23161  while (argname != first_kw_arg) {
23162  int cmp = (**argname == key) ? 0 :
23163  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23164  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23165  #endif
23166  PyUnicode_Compare(**argname, key);
23167  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23168  if (cmp == 0) goto arg_passed_twice;
23169  argname++;
23170  }
23171  }
23172  } else
23173  goto invalid_keyword_type;
23174  if (kwds2) {
23175  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23176  } else {
23177  goto invalid_keyword;
23178  }
23179  }
23180  return 0;
23181 arg_passed_twice:
23182  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23183  goto bad;
23184 invalid_keyword_type:
23185  PyErr_Format(PyExc_TypeError,
23186  "%.200s() keywords must be strings", function_name);
23187  goto bad;
23188 invalid_keyword:
23189  PyErr_Format(PyExc_TypeError,
23190  #if PY_MAJOR_VERSION < 3
23191  "%.200s() got an unexpected keyword argument '%.200s'",
23192  function_name, PyString_AsString(key));
23193  #else
23194  "%s() got an unexpected keyword argument '%U'",
23195  function_name, key);
23196  #endif
23197 bad:
23198  return -1;
23199 }
23200 
23201 /* ArgTypeTest */
23202 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23203 {
23204  if (unlikely(!type)) {
23205  PyErr_SetString(PyExc_SystemError, "Missing type object");
23206  return 0;
23207  }
23208  else if (exact) {
23209  #if PY_MAJOR_VERSION == 2
23210  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23211  #endif
23212  }
23213  else {
23214  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23215  }
23216  PyErr_Format(PyExc_TypeError,
23217  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23218  name, type->tp_name, Py_TYPE(obj)->tp_name);
23219  return 0;
23220 }
23221 
23222 /* PyDictVersioning */
23223 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
23224 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23225  PyObject *dict = Py_TYPE(obj)->tp_dict;
23226  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23227 }
23228 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23229  PyObject **dictptr = NULL;
23230  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23231  if (offset) {
23232 #if CYTHON_COMPILING_IN_CPYTHON
23233  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
23234 #else
23235  dictptr = _PyObject_GetDictPtr(obj);
23236 #endif
23237  }
23238  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
23239 }
23240 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
23241  PyObject *dict = Py_TYPE(obj)->tp_dict;
23242  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
23243  return 0;
23244  return obj_dict_version == __Pyx_get_object_dict_version(obj);
23245 }
23246 #endif
23247 
23248 /* GetModuleGlobalName */
23249 #if CYTHON_USE_DICT_VERSIONS
23250 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
23251 #else
23252 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
23253 #endif
23254 {
23255  PyObject *result;
23256 #if !CYTHON_AVOID_BORROWED_REFS
23257 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
23258  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
23259  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23260  if (likely(result)) {
23261  return __Pyx_NewRef(result);
23262  } else if (unlikely(PyErr_Occurred())) {
23263  return NULL;
23264  }
23265 #else
23266  result = PyDict_GetItem(__pyx_d, name);
23267  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23268  if (likely(result)) {
23269  return __Pyx_NewRef(result);
23270  }
23271 #endif
23272 #else
23273  result = PyObject_GetItem(__pyx_d, name);
23274  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23275  if (likely(result)) {
23276  return __Pyx_NewRef(result);
23277  }
23278  PyErr_Clear();
23279 #endif
23280  return __Pyx_GetBuiltinName(name);
23281 }
23282 
23283 /* PyCFunctionFastCall */
23284 #if CYTHON_FAST_PYCCALL
23285 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23286  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23287  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23288  PyObject *self = PyCFunction_GET_SELF(func);
23289  int flags = PyCFunction_GET_FLAGS(func);
23290  assert(PyCFunction_Check(func));
23291  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23292  assert(nargs >= 0);
23293  assert(nargs == 0 || args != NULL);
23294  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23295  because it may clear it (directly or indirectly) and so the
23296  caller loses its exception */
23297  assert(!PyErr_Occurred());
23298  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23299  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
23300  } else {
23301  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
23302  }
23303 }
23304 #endif
23305 
23306 /* PyFunctionFastCall */
23307 #if CYTHON_FAST_PYCALL
23308 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23309  PyObject *globals) {
23310  PyFrameObject *f;
23311  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23312  PyObject **fastlocals;
23313  Py_ssize_t i;
23314  PyObject *result;
23315  assert(globals != NULL);
23316  /* XXX Perhaps we should create a specialized
23317  PyFrame_New() that doesn't take locals, but does
23318  take builtins without sanity checking them.
23319  */
23320  assert(tstate != NULL);
23321  f = PyFrame_New(tstate, co, globals, NULL);
23322  if (f == NULL) {
23323  return NULL;
23324  }
23325  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23326  for (i = 0; i < na; i++) {
23327  Py_INCREF(*args);
23328  fastlocals[i] = *args++;
23329  }
23330  result = PyEval_EvalFrameEx(f,0);
23331  ++tstate->recursion_depth;
23332  Py_DECREF(f);
23333  --tstate->recursion_depth;
23334  return result;
23335 }
23336 #if 1 || PY_VERSION_HEX < 0x030600B1
23337 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23338  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23339  PyObject *globals = PyFunction_GET_GLOBALS(func);
23340  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23341  PyObject *closure;
23342 #if PY_MAJOR_VERSION >= 3
23343  PyObject *kwdefs;
23344 #endif
23345  PyObject *kwtuple, **k;
23346  PyObject **d;
23347  Py_ssize_t nd;
23348  Py_ssize_t nk;
23349  PyObject *result;
23350  assert(kwargs == NULL || PyDict_Check(kwargs));
23351  nk = kwargs ? PyDict_Size(kwargs) : 0;
23352  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
23353  return NULL;
23354  }
23355  if (
23356 #if PY_MAJOR_VERSION >= 3
23357  co->co_kwonlyargcount == 0 &&
23358 #endif
23359  likely(kwargs == NULL || nk == 0) &&
23360  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23361  if (argdefs == NULL && co->co_argcount == nargs) {
23362  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23363  goto done;
23364  }
23365  else if (nargs == 0 && argdefs != NULL
23366  && co->co_argcount == Py_SIZE(argdefs)) {
23367  /* function called with no arguments, but all parameters have
23368  a default value: use default values as arguments .*/
23369  args = &PyTuple_GET_ITEM(argdefs, 0);
23370  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23371  goto done;
23372  }
23373  }
23374  if (kwargs != NULL) {
23375  Py_ssize_t pos, i;
23376  kwtuple = PyTuple_New(2 * nk);
23377  if (kwtuple == NULL) {
23378  result = NULL;
23379  goto done;
23380  }
23381  k = &PyTuple_GET_ITEM(kwtuple, 0);
23382  pos = i = 0;
23383  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23384  Py_INCREF(k[i]);
23385  Py_INCREF(k[i+1]);
23386  i += 2;
23387  }
23388  nk = i / 2;
23389  }
23390  else {
23391  kwtuple = NULL;
23392  k = NULL;
23393  }
23394  closure = PyFunction_GET_CLOSURE(func);
23395 #if PY_MAJOR_VERSION >= 3
23396  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23397 #endif
23398  if (argdefs != NULL) {
23399  d = &PyTuple_GET_ITEM(argdefs, 0);
23400  nd = Py_SIZE(argdefs);
23401  }
23402  else {
23403  d = NULL;
23404  nd = 0;
23405  }
23406 #if PY_MAJOR_VERSION >= 3
23407  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23408  args, (int)nargs,
23409  k, (int)nk,
23410  d, (int)nd, kwdefs, closure);
23411 #else
23412  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23413  args, (int)nargs,
23414  k, (int)nk,
23415  d, (int)nd, closure);
23416 #endif
23417  Py_XDECREF(kwtuple);
23418 done:
23419  Py_LeaveRecursiveCall();
23420  return result;
23421 }
23422 #endif
23423 #endif
23424 
23425 /* PyObjectCall2Args */
23426 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
23427  PyObject *args, *result = NULL;
23428  #if CYTHON_FAST_PYCALL
23429  if (PyFunction_Check(function)) {
23430  PyObject *args[2] = {arg1, arg2};
23431  return __Pyx_PyFunction_FastCall(function, args, 2);
23432  }
23433  #endif
23434  #if CYTHON_FAST_PYCCALL
23435  if (__Pyx_PyFastCFunction_Check(function)) {
23436  PyObject *args[2] = {arg1, arg2};
23437  return __Pyx_PyCFunction_FastCall(function, args, 2);
23438  }
23439  #endif
23440  args = PyTuple_New(2);
23441  if (unlikely(!args)) goto done;
23442  Py_INCREF(arg1);
23443  PyTuple_SET_ITEM(args, 0, arg1);
23444  Py_INCREF(arg2);
23445  PyTuple_SET_ITEM(args, 1, arg2);
23446  Py_INCREF(function);
23447  result = __Pyx_PyObject_Call(function, args, NULL);
23448  Py_DECREF(args);
23449  Py_DECREF(function);
23450 done:
23451  return result;
23452 }
23453 
23454 /* PyObjectCallMethO */
23455 #if CYTHON_COMPILING_IN_CPYTHON
23456 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23457  PyObject *self, *result;
23458  PyCFunction cfunc;
23459  cfunc = PyCFunction_GET_FUNCTION(func);
23460  self = PyCFunction_GET_SELF(func);
23461  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23462  return NULL;
23463  result = cfunc(self, arg);
23464  Py_LeaveRecursiveCall();
23465  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23466  PyErr_SetString(
23467  PyExc_SystemError,
23468  "NULL result without error in PyObject_Call");
23469  }
23470  return result;
23471 }
23472 #endif
23473 
23474 /* PyObjectCallOneArg */
23475 #if CYTHON_COMPILING_IN_CPYTHON
23476 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23477  PyObject *result;
23478  PyObject *args = PyTuple_New(1);
23479  if (unlikely(!args)) return NULL;
23480  Py_INCREF(arg);
23481  PyTuple_SET_ITEM(args, 0, arg);
23482  result = __Pyx_PyObject_Call(func, args, NULL);
23483  Py_DECREF(args);
23484  return result;
23485 }
23486 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23487 #if CYTHON_FAST_PYCALL
23488  if (PyFunction_Check(func)) {
23489  return __Pyx_PyFunction_FastCall(func, &arg, 1);
23490  }
23491 #endif
23492  if (likely(PyCFunction_Check(func))) {
23493  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23494  return __Pyx_PyObject_CallMethO(func, arg);
23495 #if CYTHON_FAST_PYCCALL
23496  } else if (__Pyx_PyFastCFunction_Check(func)) {
23497  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23498 #endif
23499  }
23500  }
23501  return __Pyx__PyObject_CallOneArg(func, arg);
23502 }
23503 #else
23504 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23505  PyObject *result;
23506  PyObject *args = PyTuple_Pack(1, arg);
23507  if (unlikely(!args)) return NULL;
23508  result = __Pyx_PyObject_Call(func, args, NULL);
23509  Py_DECREF(args);
23510  return result;
23511 }
23512 #endif
23513 
23514 /* UnicodeEquals */
23515 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
23516 #if CYTHON_COMPILING_IN_PYPY
23517  return PyObject_RichCompareBool(s1, s2, equals);
23518 #else
23519 #if PY_MAJOR_VERSION < 3
23520  PyObject* owned_ref = NULL;
23521 #endif
23522  int s1_is_unicode, s2_is_unicode;
23523  if (s1 == s2) {
23524  goto return_eq;
23525  }
23526  s1_is_unicode = PyUnicode_CheckExact(s1);
23527  s2_is_unicode = PyUnicode_CheckExact(s2);
23528 #if PY_MAJOR_VERSION < 3
23529  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23530  owned_ref = PyUnicode_FromObject(s2);
23531  if (unlikely(!owned_ref))
23532  return -1;
23533  s2 = owned_ref;
23534  s2_is_unicode = 1;
23535  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23536  owned_ref = PyUnicode_FromObject(s1);
23537  if (unlikely(!owned_ref))
23538  return -1;
23539  s1 = owned_ref;
23540  s1_is_unicode = 1;
23541  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23542  return __Pyx_PyBytes_Equals(s1, s2, equals);
23543  }
23544 #endif
23545  if (s1_is_unicode & s2_is_unicode) {
23546  Py_ssize_t length;
23547  int kind;
23548  void *data1, *data2;
23549  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23550  return -1;
23551  length = __Pyx_PyUnicode_GET_LENGTH(s1);
23552  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23553  goto return_ne;
23554  }
23555 #if CYTHON_USE_UNICODE_INTERNALS
23556  {
23557  Py_hash_t hash1, hash2;
23558  #if CYTHON_PEP393_ENABLED
23559  hash1 = ((PyASCIIObject*)s1)->hash;
23560  hash2 = ((PyASCIIObject*)s2)->hash;
23561  #else
23562  hash1 = ((PyUnicodeObject*)s1)->hash;
23563  hash2 = ((PyUnicodeObject*)s2)->hash;
23564  #endif
23565  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23566  goto return_ne;
23567  }
23568  }
23569 #endif
23570  kind = __Pyx_PyUnicode_KIND(s1);
23571  if (kind != __Pyx_PyUnicode_KIND(s2)) {
23572  goto return_ne;
23573  }
23574  data1 = __Pyx_PyUnicode_DATA(s1);
23575  data2 = __Pyx_PyUnicode_DATA(s2);
23576  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23577  goto return_ne;
23578  } else if (length == 1) {
23579  goto return_eq;
23580  } else {
23581  int result = memcmp(data1, data2, (size_t)(length * kind));
23582  #if PY_MAJOR_VERSION < 3
23583  Py_XDECREF(owned_ref);
23584  #endif
23585  return (equals == Py_EQ) ? (result == 0) : (result != 0);
23586  }
23587  } else if ((s1 == Py_None) & s2_is_unicode) {
23588  goto return_ne;
23589  } else if ((s2 == Py_None) & s1_is_unicode) {
23590  goto return_ne;
23591  } else {
23592  int result;
23593  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23594  #if PY_MAJOR_VERSION < 3
23595  Py_XDECREF(owned_ref);
23596  #endif
23597  if (!py_result)
23598  return -1;
23599  result = __Pyx_PyObject_IsTrue(py_result);
23600  Py_DECREF(py_result);
23601  return result;
23602  }
23603 return_eq:
23604  #if PY_MAJOR_VERSION < 3
23605  Py_XDECREF(owned_ref);
23606  #endif
23607  return (equals == Py_EQ);
23608 return_ne:
23609  #if PY_MAJOR_VERSION < 3
23610  Py_XDECREF(owned_ref);
23611  #endif
23612  return (equals == Py_NE);
23613 #endif
23614 }
23615 
23616 /* GetAttr */
23617 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
23618 #if CYTHON_USE_TYPE_SLOTS
23619 #if PY_MAJOR_VERSION >= 3
23620  if (likely(PyUnicode_Check(n)))
23621 #else
23622  if (likely(PyString_Check(n)))
23623 #endif
23624  return __Pyx_PyObject_GetAttrStr(o, n);
23625 #endif
23626  return PyObject_GetAttr(o, n);
23627 }
23628 
23629 /* GetItemInt */
23630 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23631  PyObject *r;
23632  if (!j) return NULL;
23633  r = PyObject_GetItem(o, j);
23634  Py_DECREF(j);
23635  return r;
23636 }
23637 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23638  CYTHON_NCP_UNUSED int wraparound,
23639  CYTHON_NCP_UNUSED int boundscheck) {
23640 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23641  Py_ssize_t wrapped_i = i;
23642  if (wraparound & unlikely(i < 0)) {
23643  wrapped_i += PyList_GET_SIZE(o);
23644  }
23645  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
23646  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23647  Py_INCREF(r);
23648  return r;
23649  }
23650  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23651 #else
23652  return PySequence_GetItem(o, i);
23653 #endif
23654 }
23655 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23656  CYTHON_NCP_UNUSED int wraparound,
23657  CYTHON_NCP_UNUSED int boundscheck) {
23658 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23659  Py_ssize_t wrapped_i = i;
23660  if (wraparound & unlikely(i < 0)) {
23661  wrapped_i += PyTuple_GET_SIZE(o);
23662  }
23663  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
23664  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23665  Py_INCREF(r);
23666  return r;
23667  }
23668  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23669 #else
23670  return PySequence_GetItem(o, i);
23671 #endif
23672 }
23673 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
23674  CYTHON_NCP_UNUSED int wraparound,
23675  CYTHON_NCP_UNUSED int boundscheck) {
23676 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23677  if (is_list || PyList_CheckExact(o)) {
23678  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23679  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
23680  PyObject *r = PyList_GET_ITEM(o, n);
23681  Py_INCREF(r);
23682  return r;
23683  }
23684  }
23685  else if (PyTuple_CheckExact(o)) {
23686  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23687  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
23688  PyObject *r = PyTuple_GET_ITEM(o, n);
23689  Py_INCREF(r);
23690  return r;
23691  }
23692  } else {
23693  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23694  if (likely(m && m->sq_item)) {
23695  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23696  Py_ssize_t l = m->sq_length(o);
23697  if (likely(l >= 0)) {
23698  i += l;
23699  } else {
23700  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23701  return NULL;
23702  PyErr_Clear();
23703  }
23704  }
23705  return m->sq_item(o, i);
23706  }
23707  }
23708 #else
23709  if (is_list || PySequence_Check(o)) {
23710  return PySequence_GetItem(o, i);
23711  }
23712 #endif
23713  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23714 }
23715 
23716 /* ObjectGetItem */
23717 #if CYTHON_USE_TYPE_SLOTS
23718 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23719  PyObject *runerr = NULL;
23720  Py_ssize_t key_value;
23721  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23722  if (unlikely(!(m && m->sq_item))) {
23723  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23724  return NULL;
23725  }
23726  key_value = __Pyx_PyIndex_AsSsize_t(index);
23727  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23728  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23729  }
23730  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23731  PyErr_Clear();
23732  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23733  }
23734  return NULL;
23735 }
23736 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23737  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23738  if (likely(m && m->mp_subscript)) {
23739  return m->mp_subscript(obj, key);
23740  }
23741  return __Pyx_PyObject_GetIndex(obj, key);
23742 }
23743 #endif
23744 
23745 /* decode_c_string */
23746 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
23747  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
23748  const char* encoding, const char* errors,
23749  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
23750  Py_ssize_t length;
23751  if (unlikely((start < 0) | (stop < 0))) {
23752  size_t slen = strlen(cstring);
23753  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
23754  PyErr_SetString(PyExc_OverflowError,
23755  "c-string too long to convert to Python");
23756  return NULL;
23757  }
23758  length = (Py_ssize_t) slen;
23759  if (start < 0) {
23760  start += length;
23761  if (start < 0)
23762  start = 0;
23763  }
23764  if (stop < 0)
23765  stop += length;
23766  }
23767  if (unlikely(stop <= start))
23768  return __Pyx_NewRef(__pyx_empty_unicode);
23769  length = stop - start;
23770  cstring += start;
23771  if (decode_func) {
23772  return decode_func(cstring, length, errors);
23773  } else {
23774  return PyUnicode_Decode(cstring, length, encoding, errors);
23775  }
23776 }
23777 
23778 /* PyErrExceptionMatches */
23779 #if CYTHON_FAST_THREAD_STATE
23780 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23781  Py_ssize_t i, n;
23782  n = PyTuple_GET_SIZE(tuple);
23783 #if PY_MAJOR_VERSION >= 3
23784  for (i=0; i<n; i++) {
23785  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
23786  }
23787 #endif
23788  for (i=0; i<n; i++) {
23789  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
23790  }
23791  return 0;
23792 }
23793 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
23794  PyObject *exc_type = tstate->curexc_type;
23795  if (exc_type == err) return 1;
23796  if (unlikely(!exc_type)) return 0;
23797  if (unlikely(PyTuple_Check(err)))
23798  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
23799  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
23800 }
23801 #endif
23802 
23803 /* GetAttr3 */
23804 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
23805  __Pyx_PyThreadState_declare
23806  __Pyx_PyThreadState_assign
23807  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23808  return NULL;
23809  __Pyx_PyErr_Clear();
23810  Py_INCREF(d);
23811  return d;
23812 }
23813 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
23814  PyObject *r = __Pyx_GetAttr(o, n);
23815  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
23816 }
23817 
23818 /* RaiseTooManyValuesToUnpack */
23819 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
23820  PyErr_Format(PyExc_ValueError,
23821  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
23822 }
23823 
23824 /* RaiseNeedMoreValuesToUnpack */
23825 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
23826  PyErr_Format(PyExc_ValueError,
23827  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
23828  index, (index == 1) ? "" : "s");
23829 }
23830 
23831 /* RaiseNoneIterError */
23832 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
23833  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
23834 }
23835 
23836 /* ExtTypeTest */
23837 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
23838  if (unlikely(!type)) {
23839  PyErr_SetString(PyExc_SystemError, "Missing type object");
23840  return 0;
23841  }
23842  if (likely(__Pyx_TypeCheck(obj, type)))
23843  return 1;
23844  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
23845  Py_TYPE(obj)->tp_name, type->tp_name);
23846  return 0;
23847 }
23848 
23849 /* GetTopmostException */
23850 #if CYTHON_USE_EXC_INFO_STACK
23851 static _PyErr_StackItem *
23852 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
23853 {
23854  _PyErr_StackItem *exc_info = tstate->exc_info;
23855  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
23856  exc_info->previous_item != NULL)
23857  {
23858  exc_info = exc_info->previous_item;
23859  }
23860  return exc_info;
23861 }
23862 #endif
23863 
23864 /* SaveResetException */
23865 #if CYTHON_FAST_THREAD_STATE
23866 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23867  #if CYTHON_USE_EXC_INFO_STACK
23868  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
23869  *type = exc_info->exc_type;
23870  *value = exc_info->exc_value;
23871  *tb = exc_info->exc_traceback;
23872  #else
23873  *type = tstate->exc_type;
23874  *value = tstate->exc_value;
23875  *tb = tstate->exc_traceback;
23876  #endif
23877  Py_XINCREF(*type);
23878  Py_XINCREF(*value);
23879  Py_XINCREF(*tb);
23880 }
23881 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23882  PyObject *tmp_type, *tmp_value, *tmp_tb;
23883  #if CYTHON_USE_EXC_INFO_STACK
23884  _PyErr_StackItem *exc_info = tstate->exc_info;
23885  tmp_type = exc_info->exc_type;
23886  tmp_value = exc_info->exc_value;
23887  tmp_tb = exc_info->exc_traceback;
23888  exc_info->exc_type = type;
23889  exc_info->exc_value = value;
23890  exc_info->exc_traceback = tb;
23891  #else
23892  tmp_type = tstate->exc_type;
23893  tmp_value = tstate->exc_value;
23894  tmp_tb = tstate->exc_traceback;
23895  tstate->exc_type = type;
23896  tstate->exc_value = value;
23897  tstate->exc_traceback = tb;
23898  #endif
23899  Py_XDECREF(tmp_type);
23900  Py_XDECREF(tmp_value);
23901  Py_XDECREF(tmp_tb);
23902 }
23903 #endif
23904 
23905 /* GetException */
23906 #if CYTHON_FAST_THREAD_STATE
23907 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
23908 #else
23909 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
23910 #endif
23911 {
23912  PyObject *local_type, *local_value, *local_tb;
23913 #if CYTHON_FAST_THREAD_STATE
23914  PyObject *tmp_type, *tmp_value, *tmp_tb;
23915  local_type = tstate->curexc_type;
23916  local_value = tstate->curexc_value;
23917  local_tb = tstate->curexc_traceback;
23918  tstate->curexc_type = 0;
23919  tstate->curexc_value = 0;
23920  tstate->curexc_traceback = 0;
23921 #else
23922  PyErr_Fetch(&local_type, &local_value, &local_tb);
23923 #endif
23924  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
23925 #if CYTHON_FAST_THREAD_STATE
23926  if (unlikely(tstate->curexc_type))
23927 #else
23928  if (unlikely(PyErr_Occurred()))
23929 #endif
23930  goto bad;
23931  #if PY_MAJOR_VERSION >= 3
23932  if (local_tb) {
23933  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
23934  goto bad;
23935  }
23936  #endif
23937  Py_XINCREF(local_tb);
23938  Py_XINCREF(local_type);
23939  Py_XINCREF(local_value);
23940  *type = local_type;
23941  *value = local_value;
23942  *tb = local_tb;
23943 #if CYTHON_FAST_THREAD_STATE
23944  #if CYTHON_USE_EXC_INFO_STACK
23945  {
23946  _PyErr_StackItem *exc_info = tstate->exc_info;
23947  tmp_type = exc_info->exc_type;
23948  tmp_value = exc_info->exc_value;
23949  tmp_tb = exc_info->exc_traceback;
23950  exc_info->exc_type = local_type;
23951  exc_info->exc_value = local_value;
23952  exc_info->exc_traceback = local_tb;
23953  }
23954  #else
23955  tmp_type = tstate->exc_type;
23956  tmp_value = tstate->exc_value;
23957  tmp_tb = tstate->exc_traceback;
23958  tstate->exc_type = local_type;
23959  tstate->exc_value = local_value;
23960  tstate->exc_traceback = local_tb;
23961  #endif
23962  Py_XDECREF(tmp_type);
23963  Py_XDECREF(tmp_value);
23964  Py_XDECREF(tmp_tb);
23965 #else
23966  PyErr_SetExcInfo(local_type, local_value, local_tb);
23967 #endif
23968  return 0;
23969 bad:
23970  *type = 0;
23971  *value = 0;
23972  *tb = 0;
23973  Py_XDECREF(local_type);
23974  Py_XDECREF(local_value);
23975  Py_XDECREF(local_tb);
23976  return -1;
23977 }
23978 
23979 /* SwapException */
23980 #if CYTHON_FAST_THREAD_STATE
23981 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23982  PyObject *tmp_type, *tmp_value, *tmp_tb;
23983  #if CYTHON_USE_EXC_INFO_STACK
23984  _PyErr_StackItem *exc_info = tstate->exc_info;
23985  tmp_type = exc_info->exc_type;
23986  tmp_value = exc_info->exc_value;
23987  tmp_tb = exc_info->exc_traceback;
23988  exc_info->exc_type = *type;
23989  exc_info->exc_value = *value;
23990  exc_info->exc_traceback = *tb;
23991  #else
23992  tmp_type = tstate->exc_type;
23993  tmp_value = tstate->exc_value;
23994  tmp_tb = tstate->exc_traceback;
23995  tstate->exc_type = *type;
23996  tstate->exc_value = *value;
23997  tstate->exc_traceback = *tb;
23998  #endif
23999  *type = tmp_type;
24000  *value = tmp_value;
24001  *tb = tmp_tb;
24002 }
24003 #else
24004 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
24005  PyObject *tmp_type, *tmp_value, *tmp_tb;
24006  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
24007  PyErr_SetExcInfo(*type, *value, *tb);
24008  *type = tmp_type;
24009  *value = tmp_value;
24010  *tb = tmp_tb;
24011 }
24012 #endif
24013 
24014 /* Import */
24015 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
24016  PyObject *empty_list = 0;
24017  PyObject *module = 0;
24018  PyObject *global_dict = 0;
24019  PyObject *empty_dict = 0;
24020  PyObject *list;
24021  #if PY_MAJOR_VERSION < 3
24022  PyObject *py_import;
24023  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24024  if (!py_import)
24025  goto bad;
24026  #endif
24027  if (from_list)
24028  list = from_list;
24029  else {
24030  empty_list = PyList_New(0);
24031  if (!empty_list)
24032  goto bad;
24033  list = empty_list;
24034  }
24035  global_dict = PyModule_GetDict(__pyx_m);
24036  if (!global_dict)
24037  goto bad;
24038  empty_dict = PyDict_New();
24039  if (!empty_dict)
24040  goto bad;
24041  {
24042  #if PY_MAJOR_VERSION >= 3
24043  if (level == -1) {
24044  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24045  module = PyImport_ImportModuleLevelObject(
24046  name, global_dict, empty_dict, list, 1);
24047  if (!module) {
24048  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24049  goto bad;
24050  PyErr_Clear();
24051  }
24052  }
24053  level = 0;
24054  }
24055  #endif
24056  if (!module) {
24057  #if PY_MAJOR_VERSION < 3
24058  PyObject *py_level = PyInt_FromLong(level);
24059  if (!py_level)
24060  goto bad;
24061  module = PyObject_CallFunctionObjArgs(py_import,
24062  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24063  Py_DECREF(py_level);
24064  #else
24065  module = PyImport_ImportModuleLevelObject(
24066  name, global_dict, empty_dict, list, level);
24067  #endif
24068  }
24069  }
24070 bad:
24071  #if PY_MAJOR_VERSION < 3
24072  Py_XDECREF(py_import);
24073  #endif
24074  Py_XDECREF(empty_list);
24075  Py_XDECREF(empty_dict);
24076  return module;
24077 }
24078 
24079 /* FastTypeChecks */
24080 #if CYTHON_COMPILING_IN_CPYTHON
24081 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24082  while (a) {
24083  a = a->tp_base;
24084  if (a == b)
24085  return 1;
24086  }
24087  return b == &PyBaseObject_Type;
24088 }
24089 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24090  PyObject *mro;
24091  if (a == b) return 1;
24092  mro = a->tp_mro;
24093  if (likely(mro)) {
24094  Py_ssize_t i, n;
24095  n = PyTuple_GET_SIZE(mro);
24096  for (i = 0; i < n; i++) {
24097  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24098  return 1;
24099  }
24100  return 0;
24101  }
24102  return __Pyx_InBases(a, b);
24103 }
24104 #if PY_MAJOR_VERSION == 2
24105 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24106  PyObject *exception, *value, *tb;
24107  int res;
24108  __Pyx_PyThreadState_declare
24109  __Pyx_PyThreadState_assign
24110  __Pyx_ErrFetch(&exception, &value, &tb);
24111  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24112  if (unlikely(res == -1)) {
24113  PyErr_WriteUnraisable(err);
24114  res = 0;
24115  }
24116  if (!res) {
24117  res = PyObject_IsSubclass(err, exc_type2);
24118  if (unlikely(res == -1)) {
24119  PyErr_WriteUnraisable(err);
24120  res = 0;
24121  }
24122  }
24123  __Pyx_ErrRestore(exception, value, tb);
24124  return res;
24125 }
24126 #else
24127 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24128  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24129  if (!res) {
24130  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24131  }
24132  return res;
24133 }
24134 #endif
24135 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24136  Py_ssize_t i, n;
24137  assert(PyExceptionClass_Check(exc_type));
24138  n = PyTuple_GET_SIZE(tuple);
24139 #if PY_MAJOR_VERSION >= 3
24140  for (i=0; i<n; i++) {
24141  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24142  }
24143 #endif
24144  for (i=0; i<n; i++) {
24145  PyObject *t = PyTuple_GET_ITEM(tuple, i);
24146  #if PY_MAJOR_VERSION < 3
24147  if (likely(exc_type == t)) return 1;
24148  #endif
24149  if (likely(PyExceptionClass_Check(t))) {
24150  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
24151  } else {
24152  }
24153  }
24154  return 0;
24155 }
24156 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24157  if (likely(err == exc_type)) return 1;
24158  if (likely(PyExceptionClass_Check(err))) {
24159  if (likely(PyExceptionClass_Check(exc_type))) {
24160  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24161  } else if (likely(PyTuple_Check(exc_type))) {
24162  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24163  } else {
24164  }
24165  }
24166  return PyErr_GivenExceptionMatches(err, exc_type);
24167 }
24168 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24169  assert(PyExceptionClass_Check(exc_type1));
24170  assert(PyExceptionClass_Check(exc_type2));
24171  if (likely(err == exc_type1 || err == exc_type2)) return 1;
24172  if (likely(PyExceptionClass_Check(err))) {
24173  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24174  }
24175  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24176 }
24177 #endif
24178 
24179 /* PyIntBinop */
24180 #if !CYTHON_COMPILING_IN_PYPY
24181 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
24182  (void)inplace;
24183  (void)zerodivision_check;
24184  #if PY_MAJOR_VERSION < 3
24185  if (likely(PyInt_CheckExact(op1))) {
24186  const long b = intval;
24187  long x;
24188  long a = PyInt_AS_LONG(op1);
24189  x = (long)((unsigned long)a + b);
24190  if (likely((x^a) >= 0 || (x^b) >= 0))
24191  return PyInt_FromLong(x);
24192  return PyLong_Type.tp_as_number->nb_add(op1, op2);
24193  }
24194  #endif
24195  #if CYTHON_USE_PYLONG_INTERNALS
24196  if (likely(PyLong_CheckExact(op1))) {
24197  const long b = intval;
24198  long a, x;
24199 #ifdef HAVE_LONG_LONG
24200  const PY_LONG_LONG llb = intval;
24201  PY_LONG_LONG lla, llx;
24202 #endif
24203  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24204  const Py_ssize_t size = Py_SIZE(op1);
24205  if (likely(__Pyx_sst_abs(size) <= 1)) {
24206  a = likely(size) ? digits[0] : 0;
24207  if (size == -1) a = -a;
24208  } else {
24209  switch (size) {
24210  case -2:
24211  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24212  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24213  break;
24214 #ifdef HAVE_LONG_LONG
24215  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24216  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24217  goto long_long;
24218 #endif
24219  }
24220  CYTHON_FALLTHROUGH;
24221  case 2:
24222  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24223  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24224  break;
24225 #ifdef HAVE_LONG_LONG
24226  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24227  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24228  goto long_long;
24229 #endif
24230  }
24231  CYTHON_FALLTHROUGH;
24232  case -3:
24233  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24234  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24235  break;
24236 #ifdef HAVE_LONG_LONG
24237  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24238  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24239  goto long_long;
24240 #endif
24241  }
24242  CYTHON_FALLTHROUGH;
24243  case 3:
24244  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24245  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24246  break;
24247 #ifdef HAVE_LONG_LONG
24248  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24249  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24250  goto long_long;
24251 #endif
24252  }
24253  CYTHON_FALLTHROUGH;
24254  case -4:
24255  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24256  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24257  break;
24258 #ifdef HAVE_LONG_LONG
24259  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24260  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24261  goto long_long;
24262 #endif
24263  }
24264  CYTHON_FALLTHROUGH;
24265  case 4:
24266  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24267  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24268  break;
24269 #ifdef HAVE_LONG_LONG
24270  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24271  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24272  goto long_long;
24273 #endif
24274  }
24275  CYTHON_FALLTHROUGH;
24276  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24277  }
24278  }
24279  x = a + b;
24280  return PyLong_FromLong(x);
24281 #ifdef HAVE_LONG_LONG
24282  long_long:
24283  llx = lla + llb;
24284  return PyLong_FromLongLong(llx);
24285 #endif
24286 
24287 
24288  }
24289  #endif
24290  if (PyFloat_CheckExact(op1)) {
24291  const long b = intval;
24292  double a = PyFloat_AS_DOUBLE(op1);
24293  double result;
24294  PyFPE_START_PROTECT("add", return NULL)
24295  result = ((double)a) + (double)b;
24296  PyFPE_END_PROTECT(result)
24297  return PyFloat_FromDouble(result);
24298  }
24299  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24300 }
24301 #endif
24302 
24303 /* None */
24304 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
24305  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
24306 }
24307 
24308 /* ImportFrom */
24309 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24310  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24311  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24312  PyErr_Format(PyExc_ImportError,
24313  #if PY_MAJOR_VERSION < 3
24314  "cannot import name %.230s", PyString_AS_STRING(name));
24315  #else
24316  "cannot import name %S", name);
24317  #endif
24318  }
24319  return value;
24320 }
24321 
24322 /* HasAttr */
24323 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
24324  PyObject *r;
24325  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
24326  PyErr_SetString(PyExc_TypeError,
24327  "hasattr(): attribute name must be string");
24328  return -1;
24329  }
24330  r = __Pyx_GetAttr(o, n);
24331  if (unlikely(!r)) {
24332  PyErr_Clear();
24333  return 0;
24334  } else {
24335  Py_DECREF(r);
24336  return 1;
24337  }
24338 }
24339 
24340 /* PyObject_GenericGetAttrNoDict */
24341 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24342 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
24343  PyErr_Format(PyExc_AttributeError,
24344 #if PY_MAJOR_VERSION >= 3
24345  "'%.50s' object has no attribute '%U'",
24346  tp->tp_name, attr_name);
24347 #else
24348  "'%.50s' object has no attribute '%.400s'",
24349  tp->tp_name, PyString_AS_STRING(attr_name));
24350 #endif
24351  return NULL;
24352 }
24353 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
24354  PyObject *descr;
24355  PyTypeObject *tp = Py_TYPE(obj);
24356  if (unlikely(!PyString_Check(attr_name))) {
24357  return PyObject_GenericGetAttr(obj, attr_name);
24358  }
24359  assert(!tp->tp_dictoffset);
24360  descr = _PyType_Lookup(tp, attr_name);
24361  if (unlikely(!descr)) {
24362  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
24363  }
24364  Py_INCREF(descr);
24365  #if PY_MAJOR_VERSION < 3
24366  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
24367  #endif
24368  {
24369  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
24370  if (unlikely(f)) {
24371  PyObject *res = f(descr, obj, (PyObject *)tp);
24372  Py_DECREF(descr);
24373  return res;
24374  }
24375  }
24376  return descr;
24377 }
24378 #endif
24379 
24380 /* PyObject_GenericGetAttr */
24381 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24382 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
24383  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
24384  return PyObject_GenericGetAttr(obj, attr_name);
24385  }
24386  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
24387 }
24388 #endif
24389 
24390 /* SetVTable */
24391 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
24392 #if PY_VERSION_HEX >= 0x02070000
24393  PyObject *ob = PyCapsule_New(vtable, 0, 0);
24394 #else
24395  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
24396 #endif
24397  if (!ob)
24398  goto bad;
24399  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
24400  goto bad;
24401  Py_DECREF(ob);
24402  return 0;
24403 bad:
24404  Py_XDECREF(ob);
24405  return -1;
24406 }
24407 
24408 /* PyObjectGetAttrStrNoError */
24409 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
24410  __Pyx_PyThreadState_declare
24411  __Pyx_PyThreadState_assign
24412  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24413  __Pyx_PyErr_Clear();
24414 }
24415 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
24416  PyObject *result;
24417 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
24418  PyTypeObject* tp = Py_TYPE(obj);
24419  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
24420  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
24421  }
24422 #endif
24423  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
24424  if (unlikely(!result)) {
24425  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
24426  }
24427  return result;
24428 }
24429 
24430 /* SetupReduce */
24431 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
24432  int ret;
24433  PyObject *name_attr;
24434  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
24435  if (likely(name_attr)) {
24436  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
24437  } else {
24438  ret = -1;
24439  }
24440  if (unlikely(ret < 0)) {
24441  PyErr_Clear();
24442  ret = 0;
24443  }
24444  Py_XDECREF(name_attr);
24445  return ret;
24446 }
24447 static int __Pyx_setup_reduce(PyObject* type_obj) {
24448  int ret = 0;
24449  PyObject *object_reduce = NULL;
24450  PyObject *object_getstate = NULL;
24451  PyObject *object_reduce_ex = NULL;
24452  PyObject *reduce = NULL;
24453  PyObject *reduce_ex = NULL;
24454  PyObject *reduce_cython = NULL;
24455  PyObject *setstate = NULL;
24456  PyObject *setstate_cython = NULL;
24457  PyObject *getstate = NULL;
24458 #if CYTHON_USE_PYTYPE_LOOKUP
24459  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
24460 #else
24461  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
24462  if (!getstate && PyErr_Occurred()) {
24463  goto __PYX_BAD;
24464  }
24465 #endif
24466  if (getstate) {
24467 #if CYTHON_USE_PYTYPE_LOOKUP
24468  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
24469 #else
24470  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
24471  if (!object_getstate && PyErr_Occurred()) {
24472  goto __PYX_BAD;
24473  }
24474 #endif
24475  if (object_getstate != getstate) {
24476  goto __PYX_GOOD;
24477  }
24478  }
24479 #if CYTHON_USE_PYTYPE_LOOKUP
24480  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
24481 #else
24482  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
24483 #endif
24484  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
24485  if (reduce_ex == object_reduce_ex) {
24486 #if CYTHON_USE_PYTYPE_LOOKUP
24487  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
24488 #else
24489  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
24490 #endif
24491  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
24492  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
24493  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
24494  if (likely(reduce_cython)) {
24495  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24496  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24497  } else if (reduce == object_reduce || PyErr_Occurred()) {
24498  goto __PYX_BAD;
24499  }
24500  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
24501  if (!setstate) PyErr_Clear();
24502  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
24503  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
24504  if (likely(setstate_cython)) {
24505  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24506  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24507  } else if (!setstate || PyErr_Occurred()) {
24508  goto __PYX_BAD;
24509  }
24510  }
24511  PyType_Modified((PyTypeObject*)type_obj);
24512  }
24513  }
24514  goto __PYX_GOOD;
24515 __PYX_BAD:
24516  if (!PyErr_Occurred())
24517  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
24518  ret = -1;
24519 __PYX_GOOD:
24520 #if !CYTHON_USE_PYTYPE_LOOKUP
24521  Py_XDECREF(object_reduce);
24522  Py_XDECREF(object_reduce_ex);
24523  Py_XDECREF(object_getstate);
24524  Py_XDECREF(getstate);
24525 #endif
24526  Py_XDECREF(reduce);
24527  Py_XDECREF(reduce_ex);
24528  Py_XDECREF(reduce_cython);
24529  Py_XDECREF(setstate);
24530  Py_XDECREF(setstate_cython);
24531  return ret;
24532 }
24533 
24534 /* TypeImport */
24535 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
24536 #define __PYX_HAVE_RT_ImportType_0_29_36
24537 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name,
24538  size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
24539 {
24540  PyObject *result = 0;
24541  char warning[200];
24542  Py_ssize_t basicsize;
24543  Py_ssize_t itemsize;
24544 #ifdef Py_LIMITED_API
24545  PyObject *py_basicsize;
24546  PyObject *py_itemsize;
24547 #endif
24548  result = PyObject_GetAttrString(module, class_name);
24549  if (!result)
24550  goto bad;
24551  if (!PyType_Check(result)) {
24552  PyErr_Format(PyExc_TypeError,
24553  "%.200s.%.200s is not a type object",
24554  module_name, class_name);
24555  goto bad;
24556  }
24557 #ifndef Py_LIMITED_API
24558  basicsize = ((PyTypeObject *)result)->tp_basicsize;
24559  itemsize = ((PyTypeObject *)result)->tp_itemsize;
24560 #else
24561  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
24562  if (!py_basicsize)
24563  goto bad;
24564  basicsize = PyLong_AsSsize_t(py_basicsize);
24565  Py_DECREF(py_basicsize);
24566  py_basicsize = 0;
24567  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
24568  goto bad;
24569  py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
24570  if (!py_itemsize)
24571  goto bad;
24572  itemsize = PyLong_AsSsize_t(py_itemsize);
24573  Py_DECREF(py_itemsize);
24574  py_itemsize = 0;
24575  if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
24576  goto bad;
24577 #endif
24578  if (itemsize) {
24579  if (size % alignment) {
24580  alignment = size % alignment;
24581  }
24582  if (itemsize < (Py_ssize_t)alignment)
24583  itemsize = (Py_ssize_t)alignment;
24584  }
24585  if ((size_t)(basicsize + itemsize) < size) {
24586  PyErr_Format(PyExc_ValueError,
24587  "%.200s.%.200s size changed, may indicate binary incompatibility. "
24588  "Expected %zd from C header, got %zd from PyObject",
24589  module_name, class_name, size, basicsize);
24590  goto bad;
24591  }
24592  if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) {
24593  PyErr_Format(PyExc_ValueError,
24594  "%.200s.%.200s size changed, may indicate binary incompatibility. "
24595  "Expected %zd from C header, got %zd from PyObject",
24596  module_name, class_name, size, basicsize);
24597  goto bad;
24598  }
24599  else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) {
24600  PyOS_snprintf(warning, sizeof(warning),
24601  "%s.%s size changed, may indicate binary incompatibility. "
24602  "Expected %zd from C header, got %zd from PyObject",
24603  module_name, class_name, size, basicsize);
24604  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
24605  }
24606  return (PyTypeObject *)result;
24607 bad:
24608  Py_XDECREF(result);
24609  return NULL;
24610 }
24611 #endif
24612 
24613 /* GetVTable */
24614 static void* __Pyx_GetVtable(PyObject *dict) {
24615  void* ptr;
24616  PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
24617  if (!ob)
24618  goto bad;
24619 #if PY_VERSION_HEX >= 0x02070000
24620  ptr = PyCapsule_GetPointer(ob, 0);
24621 #else
24622  ptr = PyCObject_AsVoidPtr(ob);
24623 #endif
24624  if (!ptr && !PyErr_Occurred())
24625  PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
24626  Py_DECREF(ob);
24627  return ptr;
24628 bad:
24629  Py_XDECREF(ob);
24630  return NULL;
24631 }
24632 
24633 /* FetchCommonType */
24634 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24635  PyObject* fake_module;
24636  PyTypeObject* cached_type = NULL;
24637  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
24638  if (!fake_module) return NULL;
24639  Py_INCREF(fake_module);
24640  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24641  if (cached_type) {
24642  if (!PyType_Check((PyObject*)cached_type)) {
24643  PyErr_Format(PyExc_TypeError,
24644  "Shared Cython type %.200s is not a type object",
24645  type->tp_name);
24646  goto bad;
24647  }
24648  if (cached_type->tp_basicsize != type->tp_basicsize) {
24649  PyErr_Format(PyExc_TypeError,
24650  "Shared Cython type %.200s has the wrong size, try recompiling",
24651  type->tp_name);
24652  goto bad;
24653  }
24654  } else {
24655  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
24656  PyErr_Clear();
24657  if (PyType_Ready(type) < 0) goto bad;
24658  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24659  goto bad;
24660  Py_INCREF(type);
24661  cached_type = type;
24662  }
24663 done:
24664  Py_DECREF(fake_module);
24665  return cached_type;
24666 bad:
24667  Py_XDECREF(cached_type);
24668  cached_type = NULL;
24669  goto done;
24670 }
24671 
24672 /* CythonFunctionShared */
24673 #include <structmember.h>
24674 static PyObject *
24675 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
24676 {
24677  if (unlikely(op->func_doc == NULL)) {
24678  if (op->func.m_ml->ml_doc) {
24679 #if PY_MAJOR_VERSION >= 3
24680  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24681 #else
24682  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24683 #endif
24684  if (unlikely(op->func_doc == NULL))
24685  return NULL;
24686  } else {
24687  Py_INCREF(Py_None);
24688  return Py_None;
24689  }
24690  }
24691  Py_INCREF(op->func_doc);
24692  return op->func_doc;
24693 }
24694 static int
24695 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24696 {
24697  PyObject *tmp = op->func_doc;
24698  if (value == NULL) {
24699  value = Py_None;
24700  }
24701  Py_INCREF(value);
24702  op->func_doc = value;
24703  Py_XDECREF(tmp);
24704  return 0;
24705 }
24706 static PyObject *
24707 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24708 {
24709  if (unlikely(op->func_name == NULL)) {
24710 #if PY_MAJOR_VERSION >= 3
24711  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24712 #else
24713  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24714 #endif
24715  if (unlikely(op->func_name == NULL))
24716  return NULL;
24717  }
24718  Py_INCREF(op->func_name);
24719  return op->func_name;
24720 }
24721 static int
24722 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24723 {
24724  PyObject *tmp;
24725 #if PY_MAJOR_VERSION >= 3
24726  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24727 #else
24728  if (unlikely(value == NULL || !PyString_Check(value)))
24729 #endif
24730  {
24731  PyErr_SetString(PyExc_TypeError,
24732  "__name__ must be set to a string object");
24733  return -1;
24734  }
24735  tmp = op->func_name;
24736  Py_INCREF(value);
24737  op->func_name = value;
24738  Py_XDECREF(tmp);
24739  return 0;
24740 }
24741 static PyObject *
24742 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24743 {
24744  Py_INCREF(op->func_qualname);
24745  return op->func_qualname;
24746 }
24747 static int
24748 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24749 {
24750  PyObject *tmp;
24751 #if PY_MAJOR_VERSION >= 3
24752  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24753 #else
24754  if (unlikely(value == NULL || !PyString_Check(value)))
24755 #endif
24756  {
24757  PyErr_SetString(PyExc_TypeError,
24758  "__qualname__ must be set to a string object");
24759  return -1;
24760  }
24761  tmp = op->func_qualname;
24762  Py_INCREF(value);
24763  op->func_qualname = value;
24764  Py_XDECREF(tmp);
24765  return 0;
24766 }
24767 static PyObject *
24768 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
24769 {
24770  PyObject *self;
24771  self = m->func_closure;
24772  if (self == NULL)
24773  self = Py_None;
24774  Py_INCREF(self);
24775  return self;
24776 }
24777 static PyObject *
24778 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24779 {
24780  if (unlikely(op->func_dict == NULL)) {
24781  op->func_dict = PyDict_New();
24782  if (unlikely(op->func_dict == NULL))
24783  return NULL;
24784  }
24785  Py_INCREF(op->func_dict);
24786  return op->func_dict;
24787 }
24788 static int
24789 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24790 {
24791  PyObject *tmp;
24792  if (unlikely(value == NULL)) {
24793  PyErr_SetString(PyExc_TypeError,
24794  "function's dictionary may not be deleted");
24795  return -1;
24796  }
24797  if (unlikely(!PyDict_Check(value))) {
24798  PyErr_SetString(PyExc_TypeError,
24799  "setting function's dictionary to a non-dict");
24800  return -1;
24801  }
24802  tmp = op->func_dict;
24803  Py_INCREF(value);
24804  op->func_dict = value;
24805  Py_XDECREF(tmp);
24806  return 0;
24807 }
24808 static PyObject *
24809 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24810 {
24811  Py_INCREF(op->func_globals);
24812  return op->func_globals;
24813 }
24814 static PyObject *
24815 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24816 {
24817  Py_INCREF(Py_None);
24818  return Py_None;
24819 }
24820 static PyObject *
24821 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24822 {
24823  PyObject* result = (op->func_code) ? op->func_code : Py_None;
24824  Py_INCREF(result);
24825  return result;
24826 }
24827 static int
24828 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24829  int result = 0;
24830  PyObject *res = op->defaults_getter((PyObject *) op);
24831  if (unlikely(!res))
24832  return -1;
24833  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24834  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24835  Py_INCREF(op->defaults_tuple);
24836  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24837  Py_INCREF(op->defaults_kwdict);
24838  #else
24839  op->defaults_tuple = PySequence_ITEM(res, 0);
24840  if (unlikely(!op->defaults_tuple)) result = -1;
24841  else {
24842  op->defaults_kwdict = PySequence_ITEM(res, 1);
24843  if (unlikely(!op->defaults_kwdict)) result = -1;
24844  }
24845  #endif
24846  Py_DECREF(res);
24847  return result;
24848 }
24849 static int
24850 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24851  PyObject* tmp;
24852  if (!value) {
24853  value = Py_None;
24854  } else if (value != Py_None && !PyTuple_Check(value)) {
24855  PyErr_SetString(PyExc_TypeError,
24856  "__defaults__ must be set to a tuple object");
24857  return -1;
24858  }
24859  Py_INCREF(value);
24860  tmp = op->defaults_tuple;
24861  op->defaults_tuple = value;
24862  Py_XDECREF(tmp);
24863  return 0;
24864 }
24865 static PyObject *
24866 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24867  PyObject* result = op->defaults_tuple;
24868  if (unlikely(!result)) {
24869  if (op->defaults_getter) {
24870  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24871  result = op->defaults_tuple;
24872  } else {
24873  result = Py_None;
24874  }
24875  }
24876  Py_INCREF(result);
24877  return result;
24878 }
24879 static int
24880 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24881  PyObject* tmp;
24882  if (!value) {
24883  value = Py_None;
24884  } else if (value != Py_None && !PyDict_Check(value)) {
24885  PyErr_SetString(PyExc_TypeError,
24886  "__kwdefaults__ must be set to a dict object");
24887  return -1;
24888  }
24889  Py_INCREF(value);
24890  tmp = op->defaults_kwdict;
24891  op->defaults_kwdict = value;
24892  Py_XDECREF(tmp);
24893  return 0;
24894 }
24895 static PyObject *
24896 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24897  PyObject* result = op->defaults_kwdict;
24898  if (unlikely(!result)) {
24899  if (op->defaults_getter) {
24900  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24901  result = op->defaults_kwdict;
24902  } else {
24903  result = Py_None;
24904  }
24905  }
24906  Py_INCREF(result);
24907  return result;
24908 }
24909 static int
24910 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24911  PyObject* tmp;
24912  if (!value || value == Py_None) {
24913  value = NULL;
24914  } else if (!PyDict_Check(value)) {
24915  PyErr_SetString(PyExc_TypeError,
24916  "__annotations__ must be set to a dict object");
24917  return -1;
24918  }
24919  Py_XINCREF(value);
24920  tmp = op->func_annotations;
24921  op->func_annotations = value;
24922  Py_XDECREF(tmp);
24923  return 0;
24924 }
24925 static PyObject *
24926 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24927  PyObject* result = op->func_annotations;
24928  if (unlikely(!result)) {
24929  result = PyDict_New();
24930  if (unlikely(!result)) return NULL;
24931  op->func_annotations = result;
24932  }
24933  Py_INCREF(result);
24934  return result;
24935 }
24936 static PyGetSetDef __pyx_CyFunction_getsets[] = {
24937  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24938  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24939  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24940  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24941  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
24942  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
24943  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24944  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24945  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24946  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24947  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24948  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24949  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24950  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24951  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24952  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24953  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
24954  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
24955  {0, 0, 0, 0, 0}
24956 };
24957 static PyMemberDef __pyx_CyFunction_members[] = {
24958  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
24959  {0, 0, 0, 0, 0}
24960 };
24961 static PyObject *
24962 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
24963 {
24964 #if PY_MAJOR_VERSION >= 3
24965  Py_INCREF(m->func_qualname);
24966  return m->func_qualname;
24967 #else
24968  return PyString_FromString(m->func.m_ml->ml_name);
24969 #endif
24970 }
24971 static PyMethodDef __pyx_CyFunction_methods[] = {
24972  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
24973  {0, 0, 0, 0}
24974 };
24975 #if PY_VERSION_HEX < 0x030500A0
24976 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
24977 #else
24978 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
24979 #endif
24980 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
24981  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
24982  if (unlikely(op == NULL))
24983  return NULL;
24984  op->flags = flags;
24985  __Pyx_CyFunction_weakreflist(op) = NULL;
24986  op->func.m_ml = ml;
24987  op->func.m_self = (PyObject *) op;
24988  Py_XINCREF(closure);
24989  op->func_closure = closure;
24990  Py_XINCREF(module);
24991  op->func.m_module = module;
24992  op->func_dict = NULL;
24993  op->func_name = NULL;
24994  Py_INCREF(qualname);
24995  op->func_qualname = qualname;
24996  op->func_doc = NULL;
24997  op->func_classobj = NULL;
24998  op->func_globals = globals;
24999  Py_INCREF(op->func_globals);
25000  Py_XINCREF(code);
25001  op->func_code = code;
25002  op->defaults_pyobjects = 0;
25003  op->defaults_size = 0;
25004  op->defaults = NULL;
25005  op->defaults_tuple = NULL;
25006  op->defaults_kwdict = NULL;
25007  op->defaults_getter = NULL;
25008  op->func_annotations = NULL;
25009  return (PyObject *) op;
25010 }
25011 static int
25012 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25013 {
25014  Py_CLEAR(m->func_closure);
25015  Py_CLEAR(m->func.m_module);
25016  Py_CLEAR(m->func_dict);
25017  Py_CLEAR(m->func_name);
25018  Py_CLEAR(m->func_qualname);
25019  Py_CLEAR(m->func_doc);
25020  Py_CLEAR(m->func_globals);
25021  Py_CLEAR(m->func_code);
25022  Py_CLEAR(m->func_classobj);
25023  Py_CLEAR(m->defaults_tuple);
25024  Py_CLEAR(m->defaults_kwdict);
25025  Py_CLEAR(m->func_annotations);
25026  if (m->defaults) {
25027  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25028  int i;
25029  for (i = 0; i < m->defaults_pyobjects; i++)
25030  Py_XDECREF(pydefaults[i]);
25031  PyObject_Free(m->defaults);
25032  m->defaults = NULL;
25033  }
25034  return 0;
25035 }
25036 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25037 {
25038  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25039  PyObject_ClearWeakRefs((PyObject *) m);
25040  __Pyx_CyFunction_clear(m);
25041  PyObject_GC_Del(m);
25042 }
25043 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25044 {
25045  PyObject_GC_UnTrack(m);
25046  __Pyx__CyFunction_dealloc(m);
25047 }
25048 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25049 {
25050  Py_VISIT(m->func_closure);
25051  Py_VISIT(m->func.m_module);
25052  Py_VISIT(m->func_dict);
25053  Py_VISIT(m->func_name);
25054  Py_VISIT(m->func_qualname);
25055  Py_VISIT(m->func_doc);
25056  Py_VISIT(m->func_globals);
25057  Py_VISIT(m->func_code);
25058  Py_VISIT(m->func_classobj);
25059  Py_VISIT(m->defaults_tuple);
25060  Py_VISIT(m->defaults_kwdict);
25061  if (m->defaults) {
25062  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25063  int i;
25064  for (i = 0; i < m->defaults_pyobjects; i++)
25065  Py_VISIT(pydefaults[i]);
25066  }
25067  return 0;
25068 }
25069 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25070 {
25071 #if PY_MAJOR_VERSION < 3
25072  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25073  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25074  Py_INCREF(func);
25075  return func;
25076  }
25077  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25078  if (type == NULL)
25079  type = (PyObject *)(Py_TYPE(obj));
25080  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25081  }
25082  if (obj == Py_None)
25083  obj = NULL;
25084 #endif
25085  return __Pyx_PyMethod_New(func, obj, type);
25086 }
25087 static PyObject*
25088 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25089 {
25090 #if PY_MAJOR_VERSION >= 3
25091  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25092  op->func_qualname, (void *)op);
25093 #else
25094  return PyString_FromFormat("<cyfunction %s at %p>",
25095  PyString_AsString(op->func_qualname), (void *)op);
25096 #endif
25097 }
25098 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25099  PyCFunctionObject* f = (PyCFunctionObject*)func;
25100  PyCFunction meth = f->m_ml->ml_meth;
25101  Py_ssize_t size;
25102  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25103  case METH_VARARGS:
25104  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25105  return (*meth)(self, arg);
25106  break;
25107  case METH_VARARGS | METH_KEYWORDS:
25108  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
25109  case METH_NOARGS:
25110  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25111  size = PyTuple_GET_SIZE(arg);
25112  if (likely(size == 0))
25113  return (*meth)(self, NULL);
25114  PyErr_Format(PyExc_TypeError,
25115  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
25116  f->m_ml->ml_name, size);
25117  return NULL;
25118  }
25119  break;
25120  case METH_O:
25121  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25122  size = PyTuple_GET_SIZE(arg);
25123  if (likely(size == 1)) {
25124  PyObject *result, *arg0;
25125  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25126  arg0 = PyTuple_GET_ITEM(arg, 0);
25127  #else
25128  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25129  #endif
25130  result = (*meth)(self, arg0);
25131  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25132  Py_DECREF(arg0);
25133  #endif
25134  return result;
25135  }
25136  PyErr_Format(PyExc_TypeError,
25137  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25138  f->m_ml->ml_name, size);
25139  return NULL;
25140  }
25141  break;
25142  default:
25143  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25144  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25145  "longer supported!");
25146  return NULL;
25147  }
25148  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25149  f->m_ml->ml_name);
25150  return NULL;
25151 }
25152 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25153  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25154 }
25155 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25156  PyObject *result;
25157  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25158  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25159  Py_ssize_t argc;
25160  PyObject *new_args;
25161  PyObject *self;
25162  argc = PyTuple_GET_SIZE(args);
25163  new_args = PyTuple_GetSlice(args, 1, argc);
25164  if (unlikely(!new_args))
25165  return NULL;
25166  self = PyTuple_GetItem(args, 0);
25167  if (unlikely(!self)) {
25168  Py_DECREF(new_args);
25169 #if PY_MAJOR_VERSION > 2
25170  PyErr_Format(PyExc_TypeError,
25171  "unbound method %.200S() needs an argument",
25172  cyfunc->func_qualname);
25173 #else
25174  PyErr_SetString(PyExc_TypeError,
25175  "unbound method needs an argument");
25176 #endif
25177  return NULL;
25178  }
25179  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25180  Py_DECREF(new_args);
25181  } else {
25182  result = __Pyx_CyFunction_Call(func, args, kw);
25183  }
25184  return result;
25185 }
25186 static PyTypeObject __pyx_CyFunctionType_type = {
25187  PyVarObject_HEAD_INIT(0, 0)
25188  "cython_function_or_method",
25189  sizeof(__pyx_CyFunctionObject),
25190  0,
25191  (destructor) __Pyx_CyFunction_dealloc,
25192  0,
25193  0,
25194  0,
25195 #if PY_MAJOR_VERSION < 3
25196  0,
25197 #else
25198  0,
25199 #endif
25200  (reprfunc) __Pyx_CyFunction_repr,
25201  0,
25202  0,
25203  0,
25204  0,
25205  __Pyx_CyFunction_CallAsMethod,
25206  0,
25207  0,
25208  0,
25209  0,
25210  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25211  0,
25212  (traverseproc) __Pyx_CyFunction_traverse,
25213  (inquiry) __Pyx_CyFunction_clear,
25214  0,
25215 #if PY_VERSION_HEX < 0x030500A0
25216  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25217 #else
25218  offsetof(PyCFunctionObject, m_weakreflist),
25219 #endif
25220  0,
25221  0,
25222  __pyx_CyFunction_methods,
25223  __pyx_CyFunction_members,
25224  __pyx_CyFunction_getsets,
25225  0,
25226  0,
25227  __Pyx_CyFunction_descr_get,
25228  0,
25229  offsetof(__pyx_CyFunctionObject, func_dict),
25230  0,
25231  0,
25232  0,
25233  0,
25234  0,
25235  0,
25236  0,
25237  0,
25238  0,
25239  0,
25240  0,
25241  0,
25242 #if PY_VERSION_HEX >= 0x030400a1
25243  0,
25244 #endif
25245 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25246  0,
25247 #endif
25248 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25249  0,
25250 #endif
25251 #if PY_VERSION_HEX >= 0x030C0000
25252  0,
25253 #endif
25254 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25255  0,
25256 #endif
25257 };
25258 static int __pyx_CyFunction_init(void) {
25259  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25260  if (unlikely(__pyx_CyFunctionType == NULL)) {
25261  return -1;
25262  }
25263  return 0;
25264 }
25265 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25266  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25267  m->defaults = PyObject_Malloc(size);
25268  if (unlikely(!m->defaults))
25269  return PyErr_NoMemory();
25270  memset(m->defaults, 0, size);
25271  m->defaults_pyobjects = pyobjects;
25272  m->defaults_size = size;
25273  return m->defaults;
25274 }
25275 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25276  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25277  m->defaults_tuple = tuple;
25278  Py_INCREF(tuple);
25279 }
25280 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25281  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25282  m->defaults_kwdict = dict;
25283  Py_INCREF(dict);
25284 }
25285 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25286  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25287  m->func_annotations = dict;
25288  Py_INCREF(dict);
25289 }
25290 
25291 /* CythonFunction */
25292 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
25293  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25294  PyObject *op = __Pyx_CyFunction_Init(
25295  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25296  ml, flags, qualname, closure, module, globals, code
25297  );
25298  if (likely(op)) {
25299  PyObject_GC_Track(op);
25300  }
25301  return op;
25302 }
25303 
25304 /* CLineInTraceback */
25305 #ifndef CYTHON_CLINE_IN_TRACEBACK
25306 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
25307  PyObject *use_cline;
25308  PyObject *ptype, *pvalue, *ptraceback;
25309 #if CYTHON_COMPILING_IN_CPYTHON
25310  PyObject **cython_runtime_dict;
25311 #endif
25312  if (unlikely(!__pyx_cython_runtime)) {
25313  return c_line;
25314  }
25315  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25316 #if CYTHON_COMPILING_IN_CPYTHON
25317  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25318  if (likely(cython_runtime_dict)) {
25319  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25320  use_cline, *cython_runtime_dict,
25321  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25322  } else
25323 #endif
25324  {
25325  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25326  if (use_cline_obj) {
25327  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25328  Py_DECREF(use_cline_obj);
25329  } else {
25330  PyErr_Clear();
25331  use_cline = NULL;
25332  }
25333  }
25334  if (!use_cline) {
25335  c_line = 0;
25336  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25337  }
25338  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25339  c_line = 0;
25340  }
25341  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25342  return c_line;
25343 }
25344 #endif
25345 
25346 /* CodeObjectCache */
25347 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25348  int start = 0, mid = 0, end = count - 1;
25349  if (end >= 0 && code_line > entries[end].code_line) {
25350  return count;
25351  }
25352  while (start < end) {
25353  mid = start + (end - start) / 2;
25354  if (code_line < entries[mid].code_line) {
25355  end = mid;
25356  } else if (code_line > entries[mid].code_line) {
25357  start = mid + 1;
25358  } else {
25359  return mid;
25360  }
25361  }
25362  if (code_line <= entries[mid].code_line) {
25363  return mid;
25364  } else {
25365  return mid + 1;
25366  }
25367 }
25368 static PyCodeObject *__pyx_find_code_object(int code_line) {
25369  PyCodeObject* code_object;
25370  int pos;
25371  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25372  return NULL;
25373  }
25374  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25375  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25376  return NULL;
25377  }
25378  code_object = __pyx_code_cache.entries[pos].code_object;
25379  Py_INCREF(code_object);
25380  return code_object;
25381 }
25382 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25383  int pos, i;
25384  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25385  if (unlikely(!code_line)) {
25386  return;
25387  }
25388  if (unlikely(!entries)) {
25389  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
25390  if (likely(entries)) {
25391  __pyx_code_cache.entries = entries;
25392  __pyx_code_cache.max_count = 64;
25393  __pyx_code_cache.count = 1;
25394  entries[0].code_line = code_line;
25395  entries[0].code_object = code_object;
25396  Py_INCREF(code_object);
25397  }
25398  return;
25399  }
25400  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25401  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25402  PyCodeObject* tmp = entries[pos].code_object;
25403  entries[pos].code_object = code_object;
25404  Py_DECREF(tmp);
25405  return;
25406  }
25407  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25408  int new_max = __pyx_code_cache.max_count + 64;
25409  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25410  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
25411  if (unlikely(!entries)) {
25412  return;
25413  }
25414  __pyx_code_cache.entries = entries;
25415  __pyx_code_cache.max_count = new_max;
25416  }
25417  for (i=__pyx_code_cache.count; i>pos; i--) {
25418  entries[i] = entries[i-1];
25419  }
25420  entries[pos].code_line = code_line;
25421  entries[pos].code_object = code_object;
25422  __pyx_code_cache.count++;
25423  Py_INCREF(code_object);
25424 }
25425 
25426 /* AddTraceback */
25427 #include "compile.h"
25428 #include "frameobject.h"
25429 #include "traceback.h"
25430 #if PY_VERSION_HEX >= 0x030b00a6
25431  #ifndef Py_BUILD_CORE
25432  #define Py_BUILD_CORE 1
25433  #endif
25434  #include "internal/pycore_frame.h"
25435 #endif
25436 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25437  const char *funcname, int c_line,
25438  int py_line, const char *filename) {
25439  PyCodeObject *py_code = NULL;
25440  PyObject *py_funcname = NULL;
25441  #if PY_MAJOR_VERSION < 3
25442  PyObject *py_srcfile = NULL;
25443  py_srcfile = PyString_FromString(filename);
25444  if (!py_srcfile) goto bad;
25445  #endif
25446  if (c_line) {
25447  #if PY_MAJOR_VERSION < 3
25448  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25449  if (!py_funcname) goto bad;
25450  #else
25451  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25452  if (!py_funcname) goto bad;
25453  funcname = PyUnicode_AsUTF8(py_funcname);
25454  if (!funcname) goto bad;
25455  #endif
25456  }
25457  else {
25458  #if PY_MAJOR_VERSION < 3
25459  py_funcname = PyString_FromString(funcname);
25460  if (!py_funcname) goto bad;
25461  #endif
25462  }
25463  #if PY_MAJOR_VERSION < 3
25464  py_code = __Pyx_PyCode_New(
25465  0,
25466  0,
25467  0,
25468  0,
25469  0,
25470  __pyx_empty_bytes, /*PyObject *code,*/
25471  __pyx_empty_tuple, /*PyObject *consts,*/
25472  __pyx_empty_tuple, /*PyObject *names,*/
25473  __pyx_empty_tuple, /*PyObject *varnames,*/
25474  __pyx_empty_tuple, /*PyObject *freevars,*/
25475  __pyx_empty_tuple, /*PyObject *cellvars,*/
25476  py_srcfile, /*PyObject *filename,*/
25477  py_funcname, /*PyObject *name,*/
25478  py_line,
25479  __pyx_empty_bytes /*PyObject *lnotab*/
25480  );
25481  Py_DECREF(py_srcfile);
25482  #else
25483  py_code = PyCode_NewEmpty(filename, funcname, py_line);
25484  #endif
25485  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
25486  return py_code;
25487 bad:
25488  Py_XDECREF(py_funcname);
25489  #if PY_MAJOR_VERSION < 3
25490  Py_XDECREF(py_srcfile);
25491  #endif
25492  return NULL;
25493 }
25494 static void __Pyx_AddTraceback(const char *funcname, int c_line,
25495  int py_line, const char *filename) {
25496  PyCodeObject *py_code = 0;
25497  PyFrameObject *py_frame = 0;
25498  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25499  PyObject *ptype, *pvalue, *ptraceback;
25500  if (c_line) {
25501  c_line = __Pyx_CLineForTraceback(tstate, c_line);
25502  }
25503  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25504  if (!py_code) {
25505  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25506  py_code = __Pyx_CreateCodeObjectForTraceback(
25507  funcname, c_line, py_line, filename);
25508  if (!py_code) {
25509  /* If the code object creation fails, then we should clear the
25510  fetched exception references and propagate the new exception */
25511  Py_XDECREF(ptype);
25512  Py_XDECREF(pvalue);
25513  Py_XDECREF(ptraceback);
25514  goto bad;
25515  }
25516  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25517  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25518  }
25519  py_frame = PyFrame_New(
25520  tstate, /*PyThreadState *tstate,*/
25521  py_code, /*PyCodeObject *code,*/
25522  __pyx_d, /*PyObject *globals,*/
25523  0 /*PyObject *locals*/
25524  );
25525  if (!py_frame) goto bad;
25526  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25527  PyTraceBack_Here(py_frame);
25528 bad:
25529  Py_XDECREF(py_code);
25530  Py_XDECREF(py_frame);
25531 }
25532 
25533 #if PY_MAJOR_VERSION < 3
25534 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
25535  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
25536  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
25537  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
25538  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
25539  return -1;
25540 }
25541 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
25542  PyObject *obj = view->obj;
25543  if (!obj) return;
25544  if (PyObject_CheckBuffer(obj)) {
25545  PyBuffer_Release(view);
25546  return;
25547  }
25548  if ((0)) {}
25549  view->obj = NULL;
25550  Py_DECREF(obj);
25551 }
25552 #endif
25553 
25554 
25555 /* MemviewSliceIsContig */
25556 static int
25557 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
25558 {
25559  int i, index, step, start;
25560  Py_ssize_t itemsize = mvs.memview->view.itemsize;
25561  if (order == 'F') {
25562  step = 1;
25563  start = 0;
25564  } else {
25565  step = -1;
25566  start = ndim - 1;
25567  }
25568  for (i = 0; i < ndim; i++) {
25569  index = start + step * i;
25570  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
25571  return 0;
25572  itemsize *= mvs.shape[index];
25573  }
25574  return 1;
25575 }
25576 
25577 /* OverlappingSlices */
25578 static void
25579 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
25580  void **out_start, void **out_end,
25581  int ndim, size_t itemsize)
25582 {
25583  char *start, *end;
25584  int i;
25585  start = end = slice->data;
25586  for (i = 0; i < ndim; i++) {
25587  Py_ssize_t stride = slice->strides[i];
25588  Py_ssize_t extent = slice->shape[i];
25589  if (extent == 0) {
25590  *out_start = *out_end = start;
25591  return;
25592  } else {
25593  if (stride > 0)
25594  end += stride * (extent - 1);
25595  else
25596  start += stride * (extent - 1);
25597  }
25598  }
25599  *out_start = start;
25600  *out_end = end + itemsize;
25601 }
25602 static int
25603 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
25604  __Pyx_memviewslice *slice2,
25605  int ndim, size_t itemsize)
25606 {
25607  void *start1, *end1, *start2, *end2;
25608  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
25609  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
25610  return (start1 < end2) && (start2 < end1);
25611 }
25612 
25613 /* Capsule */
25614 static CYTHON_INLINE PyObject *
25615 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
25616 {
25617  PyObject *cobj;
25618 #if PY_VERSION_HEX >= 0x02070000
25619  cobj = PyCapsule_New(p, sig, NULL);
25620 #else
25621  cobj = PyCObject_FromVoidPtr(p, NULL);
25622 #endif
25623  return cobj;
25624 }
25625 
25626 /* CIntFromPyVerify */
25627 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25628  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25629 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25630  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25631 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25632  {\
25633  func_type value = func_value;\
25634  if (sizeof(target_type) < sizeof(func_type)) {\
25635  if (unlikely(value != (func_type) (target_type) value)) {\
25636  func_type zero = 0;\
25637  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25638  return (target_type) -1;\
25639  if (is_unsigned && unlikely(value < zero))\
25640  goto raise_neg_overflow;\
25641  else\
25642  goto raise_overflow;\
25643  }\
25644  }\
25645  return (target_type) value;\
25646  }
25647 
25648 /* IsLittleEndian */
25649 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
25650 {
25651  union {
25652  uint32_t u32;
25653  uint8_t u8[4];
25654  } S;
25655  S.u32 = 0x01020304;
25656  return S.u8[0] == 4;
25657 }
25658 
25659 /* BufferFormatCheck */
25660 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
25661  __Pyx_BufFmt_StackElem* stack,
25662  __Pyx_TypeInfo* type) {
25663  stack[0].field = &ctx->root;
25664  stack[0].parent_offset = 0;
25665  ctx->root.type = type;
25666  ctx->root.name = "buffer dtype";
25667  ctx->root.offset = 0;
25668  ctx->head = stack;
25669  ctx->head->field = &ctx->root;
25670  ctx->fmt_offset = 0;
25671  ctx->head->parent_offset = 0;
25672  ctx->new_packmode = '@';
25673  ctx->enc_packmode = '@';
25674  ctx->new_count = 1;
25675  ctx->enc_count = 0;
25676  ctx->enc_type = 0;
25677  ctx->is_complex = 0;
25678  ctx->is_valid_array = 0;
25679  ctx->struct_alignment = 0;
25680  while (type->typegroup == 'S') {
25681  ++ctx->head;
25682  ctx->head->field = type->fields;
25683  ctx->head->parent_offset = 0;
25684  type = type->fields->type;
25685  }
25686 }
25687 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
25688  int count;
25689  const char* t = *ts;
25690  if (*t < '0' || *t > '9') {
25691  return -1;
25692  } else {
25693  count = *t++ - '0';
25694  while (*t >= '0' && *t <= '9') {
25695  count *= 10;
25696  count += *t++ - '0';
25697  }
25698  }
25699  *ts = t;
25700  return count;
25701 }
25702 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
25703  int number = __Pyx_BufFmt_ParseNumber(ts);
25704  if (number == -1)
25705  PyErr_Format(PyExc_ValueError,\
25706  "Does not understand character buffer dtype format string ('%c')", **ts);
25707  return number;
25708 }
25709 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
25710  PyErr_Format(PyExc_ValueError,
25711  "Unexpected format string character: '%c'", ch);
25712 }
25713 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
25714  switch (ch) {
25715  case '?': return "'bool'";
25716  case 'c': return "'char'";
25717  case 'b': return "'signed char'";
25718  case 'B': return "'unsigned char'";
25719  case 'h': return "'short'";
25720  case 'H': return "'unsigned short'";
25721  case 'i': return "'int'";
25722  case 'I': return "'unsigned int'";
25723  case 'l': return "'long'";
25724  case 'L': return "'unsigned long'";
25725  case 'q': return "'long long'";
25726  case 'Q': return "'unsigned long long'";
25727  case 'f': return (is_complex ? "'complex float'" : "'float'");
25728  case 'd': return (is_complex ? "'complex double'" : "'double'");
25729  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
25730  case 'T': return "a struct";
25731  case 'O': return "Python object";
25732  case 'P': return "a pointer";
25733  case 's': case 'p': return "a string";
25734  case 0: return "end";
25735  default: return "unparseable format string";
25736  }
25737 }
25738 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
25739  switch (ch) {
25740  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25741  case 'h': case 'H': return 2;
25742  case 'i': case 'I': case 'l': case 'L': return 4;
25743  case 'q': case 'Q': return 8;
25744  case 'f': return (is_complex ? 8 : 4);
25745  case 'd': return (is_complex ? 16 : 8);
25746  case 'g': {
25747  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
25748  return 0;
25749  }
25750  case 'O': case 'P': return sizeof(void*);
25751  default:
25752  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25753  return 0;
25754  }
25755 }
25756 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
25757  switch (ch) {
25758  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25759  case 'h': case 'H': return sizeof(short);
25760  case 'i': case 'I': return sizeof(int);
25761  case 'l': case 'L': return sizeof(long);
25762  #ifdef HAVE_LONG_LONG
25763  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
25764  #endif
25765  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
25766  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
25767  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
25768  case 'O': case 'P': return sizeof(void*);
25769  default: {
25770  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25771  return 0;
25772  }
25773  }
25774 }
25775 typedef struct { char c; short x; } __Pyx_st_short;
25776 typedef struct { char c; int x; } __Pyx_st_int;
25777 typedef struct { char c; long x; } __Pyx_st_long;
25778 typedef struct { char c; float x; } __Pyx_st_float;
25779 typedef struct { char c; double x; } __Pyx_st_double;
25780 typedef struct { char c; long double x; } __Pyx_st_longdouble;
25781 typedef struct { char c; void *x; } __Pyx_st_void_p;
25782 #ifdef HAVE_LONG_LONG
25783 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
25784 #endif
25785 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
25786  switch (ch) {
25787  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25788  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
25789  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
25790  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
25791 #ifdef HAVE_LONG_LONG
25792  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
25793 #endif
25794  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
25795  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
25796  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
25797  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
25798  default:
25799  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25800  return 0;
25801  }
25802 }
25803 /* These are for computing the padding at the end of the struct to align
25804  on the first member of the struct. This will probably the same as above,
25805  but we don't have any guarantees.
25806  */
25807 typedef struct { short x; char c; } __Pyx_pad_short;
25808 typedef struct { int x; char c; } __Pyx_pad_int;
25809 typedef struct { long x; char c; } __Pyx_pad_long;
25810 typedef struct { float x; char c; } __Pyx_pad_float;
25811 typedef struct { double x; char c; } __Pyx_pad_double;
25812 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
25813 typedef struct { void *x; char c; } __Pyx_pad_void_p;
25814 #ifdef HAVE_LONG_LONG
25815 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
25816 #endif
25817 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
25818  switch (ch) {
25819  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25820  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
25821  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
25822  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
25823 #ifdef HAVE_LONG_LONG
25824  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
25825 #endif
25826  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
25827  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
25828  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
25829  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
25830  default:
25831  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25832  return 0;
25833  }
25834 }
25835 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
25836  switch (ch) {
25837  case 'c':
25838  return 'H';
25839  case 'b': case 'h': case 'i':
25840  case 'l': case 'q': case 's': case 'p':
25841  return 'I';
25842  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
25843  return 'U';
25844  case 'f': case 'd': case 'g':
25845  return (is_complex ? 'C' : 'R');
25846  case 'O':
25847  return 'O';
25848  case 'P':
25849  return 'P';
25850  default: {
25851  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25852  return 0;
25853  }
25854  }
25855 }
25856 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
25857  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
25858  const char* expected;
25859  const char* quote;
25860  if (ctx->head == NULL) {
25861  expected = "end";
25862  quote = "";
25863  } else {
25864  expected = ctx->head->field->type->name;
25865  quote = "'";
25866  }
25867  PyErr_Format(PyExc_ValueError,
25868  "Buffer dtype mismatch, expected %s%s%s but got %s",
25869  quote, expected, quote,
25870  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
25871  } else {
25872  __Pyx_StructField* field = ctx->head->field;
25873  __Pyx_StructField* parent = (ctx->head - 1)->field;
25874  PyErr_Format(PyExc_ValueError,
25875  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
25876  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
25877  parent->type->name, field->name);
25878  }
25879 }
25880 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
25881  char group;
25882  size_t size, offset, arraysize = 1;
25883  if (ctx->enc_type == 0) return 0;
25884  if (ctx->head->field->type->arraysize[0]) {
25885  int i, ndim = 0;
25886  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
25887  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
25888  ndim = 1;
25889  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
25890  PyErr_Format(PyExc_ValueError,
25891  "Expected a dimension of size %zu, got %zu",
25892  ctx->head->field->type->arraysize[0], ctx->enc_count);
25893  return -1;
25894  }
25895  }
25896  if (!ctx->is_valid_array) {
25897  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
25898  ctx->head->field->type->ndim, ndim);
25899  return -1;
25900  }
25901  for (i = 0; i < ctx->head->field->type->ndim; i++) {
25902  arraysize *= ctx->head->field->type->arraysize[i];
25903  }
25904  ctx->is_valid_array = 0;
25905  ctx->enc_count = 1;
25906  }
25907  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
25908  do {
25909  __Pyx_StructField* field = ctx->head->field;
25910  __Pyx_TypeInfo* type = field->type;
25911  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
25912  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
25913  } else {
25914  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
25915  }
25916  if (ctx->enc_packmode == '@') {
25917  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
25918  size_t align_mod_offset;
25919  if (align_at == 0) return -1;
25920  align_mod_offset = ctx->fmt_offset % align_at;
25921  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
25922  if (ctx->struct_alignment == 0)
25923  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
25924  ctx->is_complex);
25925  }
25926  if (type->size != size || type->typegroup != group) {
25927  if (type->typegroup == 'C' && type->fields != NULL) {
25928  size_t parent_offset = ctx->head->parent_offset + field->offset;
25929  ++ctx->head;
25930  ctx->head->field = type->fields;
25931  ctx->head->parent_offset = parent_offset;
25932  continue;
25933  }
25934  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
25935  } else {
25936  __Pyx_BufFmt_RaiseExpected(ctx);
25937  return -1;
25938  }
25939  }
25940  offset = ctx->head->parent_offset + field->offset;
25941  if (ctx->fmt_offset != offset) {
25942  PyErr_Format(PyExc_ValueError,
25943  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
25944  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
25945  return -1;
25946  }
25947  ctx->fmt_offset += size;
25948  if (arraysize)
25949  ctx->fmt_offset += (arraysize - 1) * size;
25950  --ctx->enc_count;
25951  while (1) {
25952  if (field == &ctx->root) {
25953  ctx->head = NULL;
25954  if (ctx->enc_count != 0) {
25955  __Pyx_BufFmt_RaiseExpected(ctx);
25956  return -1;
25957  }
25958  break;
25959  }
25960  ctx->head->field = ++field;
25961  if (field->type == NULL) {
25962  --ctx->head;
25963  field = ctx->head->field;
25964  continue;
25965  } else if (field->type->typegroup == 'S') {
25966  size_t parent_offset = ctx->head->parent_offset + field->offset;
25967  if (field->type->fields->type == NULL) continue;
25968  field = field->type->fields;
25969  ++ctx->head;
25970  ctx->head->field = field;
25971  ctx->head->parent_offset = parent_offset;
25972  break;
25973  } else {
25974  break;
25975  }
25976  }
25977  } while (ctx->enc_count);
25978  ctx->enc_type = 0;
25979  ctx->is_complex = 0;
25980  return 0;
25981 }
25982 static PyObject *
25983 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
25984 {
25985  const char *ts = *tsp;
25986  int i = 0, number, ndim;
25987  ++ts;
25988  if (ctx->new_count != 1) {
25989  PyErr_SetString(PyExc_ValueError,
25990  "Cannot handle repeated arrays in format string");
25991  return NULL;
25992  }
25993  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
25994  ndim = ctx->head->field->type->ndim;
25995  while (*ts && *ts != ')') {
25996  switch (*ts) {
25997  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
25998  default: break;
25999  }
26000  number = __Pyx_BufFmt_ExpectNumber(&ts);
26001  if (number == -1) return NULL;
26002  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
26003  return PyErr_Format(PyExc_ValueError,
26004  "Expected a dimension of size %zu, got %d",
26005  ctx->head->field->type->arraysize[i], number);
26006  if (*ts != ',' && *ts != ')')
26007  return PyErr_Format(PyExc_ValueError,
26008  "Expected a comma in format string, got '%c'", *ts);
26009  if (*ts == ',') ts++;
26010  i++;
26011  }
26012  if (i != ndim)
26013  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
26014  ctx->head->field->type->ndim, i);
26015  if (!*ts) {
26016  PyErr_SetString(PyExc_ValueError,
26017  "Unexpected end of format string, expected ')'");
26018  return NULL;
26019  }
26020  ctx->is_valid_array = 1;
26021  ctx->new_count = 1;
26022  *tsp = ++ts;
26023  return Py_None;
26024 }
26025 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
26026  int got_Z = 0;
26027  while (1) {
26028  switch(*ts) {
26029  case 0:
26030  if (ctx->enc_type != 0 && ctx->head == NULL) {
26031  __Pyx_BufFmt_RaiseExpected(ctx);
26032  return NULL;
26033  }
26034  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26035  if (ctx->head != NULL) {
26036  __Pyx_BufFmt_RaiseExpected(ctx);
26037  return NULL;
26038  }
26039  return ts;
26040  case ' ':
26041  case '\r':
26042  case '\n':
26043  ++ts;
26044  break;
26045  case '<':
26046  if (!__Pyx_Is_Little_Endian()) {
26047  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
26048  return NULL;
26049  }
26050  ctx->new_packmode = '=';
26051  ++ts;
26052  break;
26053  case '>':
26054  case '!':
26055  if (__Pyx_Is_Little_Endian()) {
26056  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
26057  return NULL;
26058  }
26059  ctx->new_packmode = '=';
26060  ++ts;
26061  break;
26062  case '=':
26063  case '@':
26064  case '^':
26065  ctx->new_packmode = *ts++;
26066  break;
26067  case 'T':
26068  {
26069  const char* ts_after_sub;
26070  size_t i, struct_count = ctx->new_count;
26071  size_t struct_alignment = ctx->struct_alignment;
26072  ctx->new_count = 1;
26073  ++ts;
26074  if (*ts != '{') {
26075  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
26076  return NULL;
26077  }
26078  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26079  ctx->enc_type = 0;
26080  ctx->enc_count = 0;
26081  ctx->struct_alignment = 0;
26082  ++ts;
26083  ts_after_sub = ts;
26084  for (i = 0; i != struct_count; ++i) {
26085  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26086  if (!ts_after_sub) return NULL;
26087  }
26088  ts = ts_after_sub;
26089  if (struct_alignment) ctx->struct_alignment = struct_alignment;
26090  }
26091  break;
26092  case '}':
26093  {
26094  size_t alignment = ctx->struct_alignment;
26095  ++ts;
26096  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26097  ctx->enc_type = 0;
26098  if (alignment && ctx->fmt_offset % alignment) {
26099  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26100  }
26101  }
26102  return ts;
26103  case 'x':
26104  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26105  ctx->fmt_offset += ctx->new_count;
26106  ctx->new_count = 1;
26107  ctx->enc_count = 0;
26108  ctx->enc_type = 0;
26109  ctx->enc_packmode = ctx->new_packmode;
26110  ++ts;
26111  break;
26112  case 'Z':
26113  got_Z = 1;
26114  ++ts;
26115  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
26116  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
26117  return NULL;
26118  }
26119  CYTHON_FALLTHROUGH;
26120  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
26121  case 'l': case 'L': case 'q': case 'Q':
26122  case 'f': case 'd': case 'g':
26123  case 'O': case 'p':
26124  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
26125  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
26126  ctx->enc_count += ctx->new_count;
26127  ctx->new_count = 1;
26128  got_Z = 0;
26129  ++ts;
26130  break;
26131  }
26132  CYTHON_FALLTHROUGH;
26133  case 's':
26134  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26135  ctx->enc_count = ctx->new_count;
26136  ctx->enc_packmode = ctx->new_packmode;
26137  ctx->enc_type = *ts;
26138  ctx->is_complex = got_Z;
26139  ++ts;
26140  ctx->new_count = 1;
26141  got_Z = 0;
26142  break;
26143  case ':':
26144  ++ts;
26145  while(*ts != ':') ++ts;
26146  ++ts;
26147  break;
26148  case '(':
26149  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
26150  break;
26151  default:
26152  {
26153  int number = __Pyx_BufFmt_ExpectNumber(&ts);
26154  if (number == -1) return NULL;
26155  ctx->new_count = (size_t)number;
26156  }
26157  }
26158  }
26159 }
26160 
26161 /* TypeInfoCompare */
26162  static int
26163 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26164 {
26165  int i;
26166  if (!a || !b)
26167  return 0;
26168  if (a == b)
26169  return 1;
26170  if (a->size != b->size || a->typegroup != b->typegroup ||
26171  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26172  if (a->typegroup == 'H' || b->typegroup == 'H') {
26173  return a->size == b->size;
26174  } else {
26175  return 0;
26176  }
26177  }
26178  if (a->ndim) {
26179  for (i = 0; i < a->ndim; i++)
26180  if (a->arraysize[i] != b->arraysize[i])
26181  return 0;
26182  }
26183  if (a->typegroup == 'S') {
26184  if (a->flags != b->flags)
26185  return 0;
26186  if (a->fields || b->fields) {
26187  if (!(a->fields && b->fields))
26188  return 0;
26189  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26190  __Pyx_StructField *field_a = a->fields + i;
26191  __Pyx_StructField *field_b = b->fields + i;
26192  if (field_a->offset != field_b->offset ||
26193  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26194  return 0;
26195  }
26196  return !a->fields[i].type && !b->fields[i].type;
26197  }
26198  }
26199  return 1;
26200 }
26201 
26202 /* MemviewSliceValidateAndInit */
26203  static int
26204 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
26205 {
26206  if (buf->shape[dim] <= 1)
26207  return 1;
26208  if (buf->strides) {
26209  if (spec & __Pyx_MEMVIEW_CONTIG) {
26210  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26211  if (unlikely(buf->strides[dim] != sizeof(void *))) {
26212  PyErr_Format(PyExc_ValueError,
26213  "Buffer is not indirectly contiguous "
26214  "in dimension %d.", dim);
26215  goto fail;
26216  }
26217  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
26218  PyErr_SetString(PyExc_ValueError,
26219  "Buffer and memoryview are not contiguous "
26220  "in the same dimension.");
26221  goto fail;
26222  }
26223  }
26224  if (spec & __Pyx_MEMVIEW_FOLLOW) {
26225  Py_ssize_t stride = buf->strides[dim];
26226  if (stride < 0)
26227  stride = -stride;
26228  if (unlikely(stride < buf->itemsize)) {
26229  PyErr_SetString(PyExc_ValueError,
26230  "Buffer and memoryview are not contiguous "
26231  "in the same dimension.");
26232  goto fail;
26233  }
26234  }
26235  } else {
26236  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
26237  PyErr_Format(PyExc_ValueError,
26238  "C-contiguous buffer is not contiguous in "
26239  "dimension %d", dim);
26240  goto fail;
26241  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
26242  PyErr_Format(PyExc_ValueError,
26243  "C-contiguous buffer is not indirect in "
26244  "dimension %d", dim);
26245  goto fail;
26246  } else if (unlikely(buf->suboffsets)) {
26247  PyErr_SetString(PyExc_ValueError,
26248  "Buffer exposes suboffsets but no strides");
26249  goto fail;
26250  }
26251  }
26252  return 1;
26253 fail:
26254  return 0;
26255 }
26256 static int
26257 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
26258 {
26259  if (spec & __Pyx_MEMVIEW_DIRECT) {
26260  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
26261  PyErr_Format(PyExc_ValueError,
26262  "Buffer not compatible with direct access "
26263  "in dimension %d.", dim);
26264  goto fail;
26265  }
26266  }
26267  if (spec & __Pyx_MEMVIEW_PTR) {
26268  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
26269  PyErr_Format(PyExc_ValueError,
26270  "Buffer is not indirectly accessible "
26271  "in dimension %d.", dim);
26272  goto fail;
26273  }
26274  }
26275  return 1;
26276 fail:
26277  return 0;
26278 }
26279 static int
26280 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
26281 {
26282  int i;
26283  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26284  Py_ssize_t stride = 1;
26285  for (i = 0; i < ndim; i++) {
26286  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26287  PyErr_SetString(PyExc_ValueError,
26288  "Buffer not fortran contiguous.");
26289  goto fail;
26290  }
26291  stride = stride * buf->shape[i];
26292  }
26293  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26294  Py_ssize_t stride = 1;
26295  for (i = ndim - 1; i >- 1; i--) {
26296  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26297  PyErr_SetString(PyExc_ValueError,
26298  "Buffer not C contiguous.");
26299  goto fail;
26300  }
26301  stride = stride * buf->shape[i];
26302  }
26303  }
26304  return 1;
26305 fail:
26306  return 0;
26307 }
26308 static int __Pyx_ValidateAndInit_memviewslice(
26309  int *axes_specs,
26310  int c_or_f_flag,
26311  int buf_flags,
26312  int ndim,
26313  __Pyx_TypeInfo *dtype,
26314  __Pyx_BufFmt_StackElem stack[],
26315  __Pyx_memviewslice *memviewslice,
26316  PyObject *original_obj)
26317 {
26318  struct __pyx_memoryview_obj *memview, *new_memview;
26319  __Pyx_RefNannyDeclarations
26320  Py_buffer *buf;
26321  int i, spec = 0, retval = -1;
26322  __Pyx_BufFmt_Context ctx;
26323  int from_memoryview = __pyx_memoryview_check(original_obj);
26324  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
26325  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
26326  original_obj)->typeinfo)) {
26327  memview = (struct __pyx_memoryview_obj *) original_obj;
26328  new_memview = NULL;
26329  } else {
26330  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26331  original_obj, buf_flags, 0, dtype);
26332  new_memview = memview;
26333  if (unlikely(!memview))
26334  goto fail;
26335  }
26336  buf = &memview->view;
26337  if (unlikely(buf->ndim != ndim)) {
26338  PyErr_Format(PyExc_ValueError,
26339  "Buffer has wrong number of dimensions (expected %d, got %d)",
26340  ndim, buf->ndim);
26341  goto fail;
26342  }
26343  if (new_memview) {
26344  __Pyx_BufFmt_Init(&ctx, stack, dtype);
26345  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
26346  }
26347  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
26348  PyErr_Format(PyExc_ValueError,
26349  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
26350  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
26351  buf->itemsize,
26352  (buf->itemsize > 1) ? "s" : "",
26353  dtype->name,
26354  dtype->size,
26355  (dtype->size > 1) ? "s" : "");
26356  goto fail;
26357  }
26358  if (buf->len > 0) {
26359  for (i = 0; i < ndim; i++) {
26360  spec = axes_specs[i];
26361  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
26362  goto fail;
26363  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26364  goto fail;
26365  }
26366  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26367  goto fail;
26368  }
26369  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26370  new_memview != NULL) == -1)) {
26371  goto fail;
26372  }
26373  retval = 0;
26374  goto no_fail;
26375 fail:
26376  Py_XDECREF(new_memview);
26377  retval = -1;
26378 no_fail:
26379  __Pyx_RefNannyFinishContext();
26380  return retval;
26381 }
26382 
26383 /* ObjectToMemviewSlice */
26384  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
26385  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26386  __Pyx_BufFmt_StackElem stack[1];
26387  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26388  int retcode;
26389  if (obj == Py_None) {
26390  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26391  return result;
26392  }
26393  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26394  PyBUF_RECORDS_RO | writable_flag, 1,
26395  &__Pyx_TypeInfo_float, stack,
26396  &result, obj);
26397  if (unlikely(retcode == -1))
26398  goto __pyx_fail;
26399  return result;
26400 __pyx_fail:
26401  result.memview = NULL;
26402  result.data = NULL;
26403  return result;
26404 }
26405 
26406 /* ObjectToMemviewSlice */
26407  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) {
26408  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26409  __Pyx_BufFmt_StackElem stack[1];
26410  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
26411  int retcode;
26412  if (obj == Py_None) {
26413  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26414  return result;
26415  }
26416  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
26417  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
26418  &__Pyx_TypeInfo_float, stack,
26419  &result, obj);
26420  if (unlikely(retcode == -1))
26421  goto __pyx_fail;
26422  return result;
26423 __pyx_fail:
26424  result.memview = NULL;
26425  result.data = NULL;
26426  return result;
26427 }
26428 
26429 /* ObjectToMemviewSlice */
26430  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
26431  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26432  __Pyx_BufFmt_StackElem stack[1];
26433  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26434  int retcode;
26435  if (obj == Py_None) {
26436  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26437  return result;
26438  }
26439  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26440  PyBUF_RECORDS_RO | writable_flag, 1,
26441  &__Pyx_TypeInfo_int, stack,
26442  &result, obj);
26443  if (unlikely(retcode == -1))
26444  goto __pyx_fail;
26445  return result;
26446 __pyx_fail:
26447  result.memview = NULL;
26448  result.data = NULL;
26449  return result;
26450 }
26451 
26452 /* ObjectToMemviewSlice */
26453  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
26454  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26455  __Pyx_BufFmt_StackElem stack[1];
26456  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26457  int retcode;
26458  if (obj == Py_None) {
26459  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26460  return result;
26461  }
26462  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26463  PyBUF_RECORDS_RO | writable_flag, 1,
26464  &__Pyx_TypeInfo_double, stack,
26465  &result, obj);
26466  if (unlikely(retcode == -1))
26467  goto __pyx_fail;
26468  return result;
26469 __pyx_fail:
26470  result.memview = NULL;
26471  result.data = NULL;
26472  return result;
26473 }
26474 
26475 /* ObjectToMemviewSlice */
26476  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
26477  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26478  __Pyx_BufFmt_StackElem stack[1];
26479  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
26480  int retcode;
26481  if (obj == Py_None) {
26482  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26483  return result;
26484  }
26485  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
26486  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
26487  &__Pyx_TypeInfo_double, stack,
26488  &result, obj);
26489  if (unlikely(retcode == -1))
26490  goto __pyx_fail;
26491  return result;
26492 __pyx_fail:
26493  result.memview = NULL;
26494  result.data = NULL;
26495  return result;
26496 }
26497 
26498 /* ObjectToMemviewSlice */
26499  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj, int writable_flag) {
26500  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26501  __Pyx_BufFmt_StackElem stack[1];
26502  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26503  int retcode;
26504  if (obj == Py_None) {
26505  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26506  return result;
26507  }
26508  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26509  PyBUF_RECORDS_RO | writable_flag, 1,
26510  &__Pyx_TypeInfo_long__double, stack,
26511  &result, obj);
26512  if (unlikely(retcode == -1))
26513  goto __pyx_fail;
26514  return result;
26515 __pyx_fail:
26516  result.memview = NULL;
26517  result.data = NULL;
26518  return result;
26519 }
26520 
26521 /* ObjectToMemviewSlice */
26522  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj, int writable_flag) {
26523  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26524  __Pyx_BufFmt_StackElem stack[1];
26525  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
26526  int retcode;
26527  if (obj == Py_None) {
26528  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26529  return result;
26530  }
26531  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
26532  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
26533  &__Pyx_TypeInfo_long__double, stack,
26534  &result, obj);
26535  if (unlikely(retcode == -1))
26536  goto __pyx_fail;
26537  return result;
26538 __pyx_fail:
26539  result.memview = NULL;
26540  result.data = NULL;
26541  return result;
26542 }
26543 
26544 /* Declarations */
26545  #if CYTHON_CCOMPLEX
26546  #ifdef __cplusplus
26547  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26548  return ::std::complex< float >(x, y);
26549  }
26550  #else
26551  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26552  return x + y*(__pyx_t_float_complex)_Complex_I;
26553  }
26554  #endif
26555 #else
26556  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26557  __pyx_t_float_complex z;
26558  z.real = x;
26559  z.imag = y;
26560  return z;
26561  }
26562 #endif
26563 
26564 /* Arithmetic */
26565  #if CYTHON_CCOMPLEX
26566 #else
26567  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26568  return (a.real == b.real) && (a.imag == b.imag);
26569  }
26570  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26571  __pyx_t_float_complex z;
26572  z.real = a.real + b.real;
26573  z.imag = a.imag + b.imag;
26574  return z;
26575  }
26576  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26577  __pyx_t_float_complex z;
26578  z.real = a.real - b.real;
26579  z.imag = a.imag - b.imag;
26580  return z;
26581  }
26582  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26583  __pyx_t_float_complex z;
26584  z.real = a.real * b.real - a.imag * b.imag;
26585  z.imag = a.real * b.imag + a.imag * b.real;
26586  return z;
26587  }
26588  #if 1
26589  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26590  if (b.imag == 0) {
26591  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26592  } else if (fabsf(b.real) >= fabsf(b.imag)) {
26593  if (b.real == 0 && b.imag == 0) {
26594  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26595  } else {
26596  float r = b.imag / b.real;
26597  float s = (float)(1.0) / (b.real + b.imag * r);
26598  return __pyx_t_float_complex_from_parts(
26599  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26600  }
26601  } else {
26602  float r = b.real / b.imag;
26603  float s = (float)(1.0) / (b.imag + b.real * r);
26604  return __pyx_t_float_complex_from_parts(
26605  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26606  }
26607  }
26608  #else
26609  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26610  if (b.imag == 0) {
26611  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26612  } else {
26613  float denom = b.real * b.real + b.imag * b.imag;
26614  return __pyx_t_float_complex_from_parts(
26615  (a.real * b.real + a.imag * b.imag) / denom,
26616  (a.imag * b.real - a.real * b.imag) / denom);
26617  }
26618  }
26619  #endif
26620  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26621  __pyx_t_float_complex z;
26622  z.real = -a.real;
26623  z.imag = -a.imag;
26624  return z;
26625  }
26626  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26627  return (a.real == 0) && (a.imag == 0);
26628  }
26629  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26630  __pyx_t_float_complex z;
26631  z.real = a.real;
26632  z.imag = -a.imag;
26633  return z;
26634  }
26635  #if 1
26636  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
26637  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26638  return sqrtf(z.real*z.real + z.imag*z.imag);
26639  #else
26640  return hypotf(z.real, z.imag);
26641  #endif
26642  }
26643  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26644  __pyx_t_float_complex z;
26645  float r, lnr, theta, z_r, z_theta;
26646  if (b.imag == 0 && b.real == (int)b.real) {
26647  if (b.real < 0) {
26648  float denom = a.real * a.real + a.imag * a.imag;
26649  a.real = a.real / denom;
26650  a.imag = -a.imag / denom;
26651  b.real = -b.real;
26652  }
26653  switch ((int)b.real) {
26654  case 0:
26655  z.real = 1;
26656  z.imag = 0;
26657  return z;
26658  case 1:
26659  return a;
26660  case 2:
26661  return __Pyx_c_prod_float(a, a);
26662  case 3:
26663  z = __Pyx_c_prod_float(a, a);
26664  return __Pyx_c_prod_float(z, a);
26665  case 4:
26666  z = __Pyx_c_prod_float(a, a);
26667  return __Pyx_c_prod_float(z, z);
26668  }
26669  }
26670  if (a.imag == 0) {
26671  if (a.real == 0) {
26672  return a;
26673  } else if ((b.imag == 0) && (a.real >= 0)) {
26674  z.real = powf(a.real, b.real);
26675  z.imag = 0;
26676  return z;
26677  } else if (a.real > 0) {
26678  r = a.real;
26679  theta = 0;
26680  } else {
26681  r = -a.real;
26682  theta = atan2f(0.0, -1.0);
26683  }
26684  } else {
26685  r = __Pyx_c_abs_float(a);
26686  theta = atan2f(a.imag, a.real);
26687  }
26688  lnr = logf(r);
26689  z_r = expf(lnr * b.real - theta * b.imag);
26690  z_theta = theta * b.real + lnr * b.imag;
26691  z.real = z_r * cosf(z_theta);
26692  z.imag = z_r * sinf(z_theta);
26693  return z;
26694  }
26695  #endif
26696 #endif
26697 
26698 /* Declarations */
26699  #if CYTHON_CCOMPLEX
26700  #ifdef __cplusplus
26701  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26702  return ::std::complex< double >(x, y);
26703  }
26704  #else
26705  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26706  return x + y*(__pyx_t_double_complex)_Complex_I;
26707  }
26708  #endif
26709 #else
26710  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26711  __pyx_t_double_complex z;
26712  z.real = x;
26713  z.imag = y;
26714  return z;
26715  }
26716 #endif
26717 
26718 /* Arithmetic */
26719  #if CYTHON_CCOMPLEX
26720 #else
26721  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26722  return (a.real == b.real) && (a.imag == b.imag);
26723  }
26724  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26725  __pyx_t_double_complex z;
26726  z.real = a.real + b.real;
26727  z.imag = a.imag + b.imag;
26728  return z;
26729  }
26730  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26731  __pyx_t_double_complex z;
26732  z.real = a.real - b.real;
26733  z.imag = a.imag - b.imag;
26734  return z;
26735  }
26736  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26737  __pyx_t_double_complex z;
26738  z.real = a.real * b.real - a.imag * b.imag;
26739  z.imag = a.real * b.imag + a.imag * b.real;
26740  return z;
26741  }
26742  #if 1
26743  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26744  if (b.imag == 0) {
26745  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26746  } else if (fabs(b.real) >= fabs(b.imag)) {
26747  if (b.real == 0 && b.imag == 0) {
26748  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26749  } else {
26750  double r = b.imag / b.real;
26751  double s = (double)(1.0) / (b.real + b.imag * r);
26752  return __pyx_t_double_complex_from_parts(
26753  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26754  }
26755  } else {
26756  double r = b.real / b.imag;
26757  double s = (double)(1.0) / (b.imag + b.real * r);
26758  return __pyx_t_double_complex_from_parts(
26759  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26760  }
26761  }
26762  #else
26763  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26764  if (b.imag == 0) {
26765  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26766  } else {
26767  double denom = b.real * b.real + b.imag * b.imag;
26768  return __pyx_t_double_complex_from_parts(
26769  (a.real * b.real + a.imag * b.imag) / denom,
26770  (a.imag * b.real - a.real * b.imag) / denom);
26771  }
26772  }
26773  #endif
26774  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26775  __pyx_t_double_complex z;
26776  z.real = -a.real;
26777  z.imag = -a.imag;
26778  return z;
26779  }
26780  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26781  return (a.real == 0) && (a.imag == 0);
26782  }
26783  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26784  __pyx_t_double_complex z;
26785  z.real = a.real;
26786  z.imag = -a.imag;
26787  return z;
26788  }
26789  #if 1
26790  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26791  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26792  return sqrt(z.real*z.real + z.imag*z.imag);
26793  #else
26794  return hypot(z.real, z.imag);
26795  #endif
26796  }
26797  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26798  __pyx_t_double_complex z;
26799  double r, lnr, theta, z_r, z_theta;
26800  if (b.imag == 0 && b.real == (int)b.real) {
26801  if (b.real < 0) {
26802  double denom = a.real * a.real + a.imag * a.imag;
26803  a.real = a.real / denom;
26804  a.imag = -a.imag / denom;
26805  b.real = -b.real;
26806  }
26807  switch ((int)b.real) {
26808  case 0:
26809  z.real = 1;
26810  z.imag = 0;
26811  return z;
26812  case 1:
26813  return a;
26814  case 2:
26815  return __Pyx_c_prod_double(a, a);
26816  case 3:
26817  z = __Pyx_c_prod_double(a, a);
26818  return __Pyx_c_prod_double(z, a);
26819  case 4:
26820  z = __Pyx_c_prod_double(a, a);
26821  return __Pyx_c_prod_double(z, z);
26822  }
26823  }
26824  if (a.imag == 0) {
26825  if (a.real == 0) {
26826  return a;
26827  } else if ((b.imag == 0) && (a.real >= 0)) {
26828  z.real = pow(a.real, b.real);
26829  z.imag = 0;
26830  return z;
26831  } else if (a.real > 0) {
26832  r = a.real;
26833  theta = 0;
26834  } else {
26835  r = -a.real;
26836  theta = atan2(0.0, -1.0);
26837  }
26838  } else {
26839  r = __Pyx_c_abs_double(a);
26840  theta = atan2(a.imag, a.real);
26841  }
26842  lnr = log(r);
26843  z_r = exp(lnr * b.real - theta * b.imag);
26844  z_theta = theta * b.real + lnr * b.imag;
26845  z.real = z_r * cos(z_theta);
26846  z.imag = z_r * sin(z_theta);
26847  return z;
26848  }
26849  #endif
26850 #endif
26851 
26852 /* MemviewSliceCopyTemplate */
26853  static __Pyx_memviewslice
26854 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
26855  const char *mode, int ndim,
26856  size_t sizeof_dtype, int contig_flag,
26857  int dtype_is_object)
26858 {
26859  __Pyx_RefNannyDeclarations
26860  int i;
26861  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26862  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26863  Py_buffer *buf = &from_memview->view;
26864  PyObject *shape_tuple = NULL;
26865  PyObject *temp_int = NULL;
26866  struct __pyx_array_obj *array_obj = NULL;
26867  struct __pyx_memoryview_obj *memview_obj = NULL;
26868  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
26869  for (i = 0; i < ndim; i++) {
26870  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26871  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
26872  "indirect dimensions (axis %d)", i);
26873  goto fail;
26874  }
26875  }
26876  shape_tuple = PyTuple_New(ndim);
26877  if (unlikely(!shape_tuple)) {
26878  goto fail;
26879  }
26880  __Pyx_GOTREF(shape_tuple);
26881  for(i = 0; i < ndim; i++) {
26882  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26883  if(unlikely(!temp_int)) {
26884  goto fail;
26885  } else {
26886  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26887  temp_int = NULL;
26888  }
26889  }
26890  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26891  if (unlikely(!array_obj)) {
26892  goto fail;
26893  }
26894  __Pyx_GOTREF(array_obj);
26895  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26896  (PyObject *) array_obj, contig_flag,
26897  dtype_is_object,
26898  from_mvs->memview->typeinfo);
26899  if (unlikely(!memview_obj))
26900  goto fail;
26901  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26902  goto fail;
26903  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26904  dtype_is_object) < 0))
26905  goto fail;
26906  goto no_fail;
26907 fail:
26908  __Pyx_XDECREF(new_mvs.memview);
26909  new_mvs.memview = NULL;
26910  new_mvs.data = NULL;
26911 no_fail:
26912  __Pyx_XDECREF(shape_tuple);
26913  __Pyx_XDECREF(temp_int);
26914  __Pyx_XDECREF(array_obj);
26915  __Pyx_RefNannyFinishContext();
26916  return new_mvs;
26917 }
26918 
26919 /* CIntFromPy */
26920  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26921 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26922 #pragma GCC diagnostic push
26923 #pragma GCC diagnostic ignored "-Wconversion"
26924 #endif
26925  const int neg_one = (int) -1, const_zero = (int) 0;
26926 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26927 #pragma GCC diagnostic pop
26928 #endif
26929  const int is_unsigned = neg_one > const_zero;
26930 #if PY_MAJOR_VERSION < 3
26931  if (likely(PyInt_Check(x))) {
26932  if (sizeof(int) < sizeof(long)) {
26933  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26934  } else {
26935  long val = PyInt_AS_LONG(x);
26936  if (is_unsigned && unlikely(val < 0)) {
26937  goto raise_neg_overflow;
26938  }
26939  return (int) val;
26940  }
26941  } else
26942 #endif
26943  if (likely(PyLong_Check(x))) {
26944  if (is_unsigned) {
26945 #if CYTHON_USE_PYLONG_INTERNALS
26946  const digit* digits = ((PyLongObject*)x)->ob_digit;
26947  switch (Py_SIZE(x)) {
26948  case 0: return (int) 0;
26949  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26950  case 2:
26951  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26952  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26953  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26954  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26955  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26956  }
26957  }
26958  break;
26959  case 3:
26960  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26961  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26962  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26963  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26964  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26965  }
26966  }
26967  break;
26968  case 4:
26969  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26970  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26971  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26972  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26973  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26974  }
26975  }
26976  break;
26977  }
26978 #endif
26979 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
26980  if (unlikely(Py_SIZE(x) < 0)) {
26981  goto raise_neg_overflow;
26982  }
26983 #else
26984  {
26985  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26986  if (unlikely(result < 0))
26987  return (int) -1;
26988  if (unlikely(result == 1))
26989  goto raise_neg_overflow;
26990  }
26991 #endif
26992  if (sizeof(int) <= sizeof(unsigned long)) {
26993  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26994 #ifdef HAVE_LONG_LONG
26995  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26996  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26997 #endif
26998  }
26999  } else {
27000 #if CYTHON_USE_PYLONG_INTERNALS
27001  const digit* digits = ((PyLongObject*)x)->ob_digit;
27002  switch (Py_SIZE(x)) {
27003  case 0: return (int) 0;
27004  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27005  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27006  case -2:
27007  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27008  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27009  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27010  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27011  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27012  }
27013  }
27014  break;
27015  case 2:
27016  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27017  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27018  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27019  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27020  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27021  }
27022  }
27023  break;
27024  case -3:
27025  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27026  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27027  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27028  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27029  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27030  }
27031  }
27032  break;
27033  case 3:
27034  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27035  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27036  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27037  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27038  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27039  }
27040  }
27041  break;
27042  case -4:
27043  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27044  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27045  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27046  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27047  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27048  }
27049  }
27050  break;
27051  case 4:
27052  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27053  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27054  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27055  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27056  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27057  }
27058  }
27059  break;
27060  }
27061 #endif
27062  if (sizeof(int) <= sizeof(long)) {
27063  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
27064 #ifdef HAVE_LONG_LONG
27065  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27066  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
27067 #endif
27068  }
27069  }
27070  {
27071 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27072  PyErr_SetString(PyExc_RuntimeError,
27073  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27074 #else
27075  int val;
27076  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27077  #if PY_MAJOR_VERSION < 3
27078  if (likely(v) && !PyLong_Check(v)) {
27079  PyObject *tmp = v;
27080  v = PyNumber_Long(tmp);
27081  Py_DECREF(tmp);
27082  }
27083  #endif
27084  if (likely(v)) {
27085  int one = 1; int is_little = (int)*(unsigned char *)&one;
27086  unsigned char *bytes = (unsigned char *)&val;
27087  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27088  bytes, sizeof(val),
27089  is_little, !is_unsigned);
27090  Py_DECREF(v);
27091  if (likely(!ret))
27092  return val;
27093  }
27094 #endif
27095  return (int) -1;
27096  }
27097  } else {
27098  int val;
27099  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27100  if (!tmp) return (int) -1;
27101  val = __Pyx_PyInt_As_int(tmp);
27102  Py_DECREF(tmp);
27103  return val;
27104  }
27105 raise_overflow:
27106  PyErr_SetString(PyExc_OverflowError,
27107  "value too large to convert to int");
27108  return (int) -1;
27109 raise_neg_overflow:
27110  PyErr_SetString(PyExc_OverflowError,
27111  "can't convert negative value to int");
27112  return (int) -1;
27113 }
27114 
27115 /* CIntToPy */
27116  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27117 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27118 #pragma GCC diagnostic push
27119 #pragma GCC diagnostic ignored "-Wconversion"
27120 #endif
27121  const long neg_one = (long) -1, const_zero = (long) 0;
27122 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27123 #pragma GCC diagnostic pop
27124 #endif
27125  const int is_unsigned = neg_one > const_zero;
27126  if (is_unsigned) {
27127  if (sizeof(long) < sizeof(long)) {
27128  return PyInt_FromLong((long) value);
27129  } else if (sizeof(long) <= sizeof(unsigned long)) {
27130  return PyLong_FromUnsignedLong((unsigned long) value);
27131 #ifdef HAVE_LONG_LONG
27132  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27133  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27134 #endif
27135  }
27136  } else {
27137  if (sizeof(long) <= sizeof(long)) {
27138  return PyInt_FromLong((long) value);
27139 #ifdef HAVE_LONG_LONG
27140  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27141  return PyLong_FromLongLong((PY_LONG_LONG) value);
27142 #endif
27143  }
27144  }
27145  {
27146  int one = 1; int little = (int)*(unsigned char *)&one;
27147  unsigned char *bytes = (unsigned char *)&value;
27148  return _PyLong_FromByteArray(bytes, sizeof(long),
27149  little, !is_unsigned);
27150  }
27151 }
27152 
27153 /* CIntToPy */
27154  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27155 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27156 #pragma GCC diagnostic push
27157 #pragma GCC diagnostic ignored "-Wconversion"
27158 #endif
27159  const int neg_one = (int) -1, const_zero = (int) 0;
27160 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27161 #pragma GCC diagnostic pop
27162 #endif
27163  const int is_unsigned = neg_one > const_zero;
27164  if (is_unsigned) {
27165  if (sizeof(int) < sizeof(long)) {
27166  return PyInt_FromLong((long) value);
27167  } else if (sizeof(int) <= sizeof(unsigned long)) {
27168  return PyLong_FromUnsignedLong((unsigned long) value);
27169 #ifdef HAVE_LONG_LONG
27170  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27171  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27172 #endif
27173  }
27174  } else {
27175  if (sizeof(int) <= sizeof(long)) {
27176  return PyInt_FromLong((long) value);
27177 #ifdef HAVE_LONG_LONG
27178  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27179  return PyLong_FromLongLong((PY_LONG_LONG) value);
27180 #endif
27181  }
27182  }
27183  {
27184  int one = 1; int little = (int)*(unsigned char *)&one;
27185  unsigned char *bytes = (unsigned char *)&value;
27186  return _PyLong_FromByteArray(bytes, sizeof(int),
27187  little, !is_unsigned);
27188  }
27189 }
27190 
27191 /* CIntFromPy */
27192  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27193 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27194 #pragma GCC diagnostic push
27195 #pragma GCC diagnostic ignored "-Wconversion"
27196 #endif
27197  const long neg_one = (long) -1, const_zero = (long) 0;
27198 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27199 #pragma GCC diagnostic pop
27200 #endif
27201  const int is_unsigned = neg_one > const_zero;
27202 #if PY_MAJOR_VERSION < 3
27203  if (likely(PyInt_Check(x))) {
27204  if (sizeof(long) < sizeof(long)) {
27205  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27206  } else {
27207  long val = PyInt_AS_LONG(x);
27208  if (is_unsigned && unlikely(val < 0)) {
27209  goto raise_neg_overflow;
27210  }
27211  return (long) val;
27212  }
27213  } else
27214 #endif
27215  if (likely(PyLong_Check(x))) {
27216  if (is_unsigned) {
27217 #if CYTHON_USE_PYLONG_INTERNALS
27218  const digit* digits = ((PyLongObject*)x)->ob_digit;
27219  switch (Py_SIZE(x)) {
27220  case 0: return (long) 0;
27221  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27222  case 2:
27223  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27224  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27225  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27226  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27227  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27228  }
27229  }
27230  break;
27231  case 3:
27232  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27233  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27234  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27235  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27236  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27237  }
27238  }
27239  break;
27240  case 4:
27241  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27242  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27243  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27244  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27245  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27246  }
27247  }
27248  break;
27249  }
27250 #endif
27251 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27252  if (unlikely(Py_SIZE(x) < 0)) {
27253  goto raise_neg_overflow;
27254  }
27255 #else
27256  {
27257  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27258  if (unlikely(result < 0))
27259  return (long) -1;
27260  if (unlikely(result == 1))
27261  goto raise_neg_overflow;
27262  }
27263 #endif
27264  if (sizeof(long) <= sizeof(unsigned long)) {
27265  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27266 #ifdef HAVE_LONG_LONG
27267  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27268  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27269 #endif
27270  }
27271  } else {
27272 #if CYTHON_USE_PYLONG_INTERNALS
27273  const digit* digits = ((PyLongObject*)x)->ob_digit;
27274  switch (Py_SIZE(x)) {
27275  case 0: return (long) 0;
27276  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
27277  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
27278  case -2:
27279  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
27280  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27281  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27282  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27283  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27284  }
27285  }
27286  break;
27287  case 2:
27288  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27289  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27290  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27291  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27292  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27293  }
27294  }
27295  break;
27296  case -3:
27297  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27298  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27299  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27300  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27301  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27302  }
27303  }
27304  break;
27305  case 3:
27306  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27307  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27308  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27309  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27310  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27311  }
27312  }
27313  break;
27314  case -4:
27315  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27316  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27317  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27318  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27319  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27320  }
27321  }
27322  break;
27323  case 4:
27324  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27325  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27326  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27327  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27328  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27329  }
27330  }
27331  break;
27332  }
27333 #endif
27334  if (sizeof(long) <= sizeof(long)) {
27335  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
27336 #ifdef HAVE_LONG_LONG
27337  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27338  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
27339 #endif
27340  }
27341  }
27342  {
27343 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27344  PyErr_SetString(PyExc_RuntimeError,
27345  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27346 #else
27347  long val;
27348  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27349  #if PY_MAJOR_VERSION < 3
27350  if (likely(v) && !PyLong_Check(v)) {
27351  PyObject *tmp = v;
27352  v = PyNumber_Long(tmp);
27353  Py_DECREF(tmp);
27354  }
27355  #endif
27356  if (likely(v)) {
27357  int one = 1; int is_little = (int)*(unsigned char *)&one;
27358  unsigned char *bytes = (unsigned char *)&val;
27359  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27360  bytes, sizeof(val),
27361  is_little, !is_unsigned);
27362  Py_DECREF(v);
27363  if (likely(!ret))
27364  return val;
27365  }
27366 #endif
27367  return (long) -1;
27368  }
27369  } else {
27370  long val;
27371  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27372  if (!tmp) return (long) -1;
27373  val = __Pyx_PyInt_As_long(tmp);
27374  Py_DECREF(tmp);
27375  return val;
27376  }
27377 raise_overflow:
27378  PyErr_SetString(PyExc_OverflowError,
27379  "value too large to convert to long");
27380  return (long) -1;
27381 raise_neg_overflow:
27382  PyErr_SetString(PyExc_OverflowError,
27383  "can't convert negative value to long");
27384  return (long) -1;
27385 }
27386 
27387 /* CIntFromPy */
27388  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
27389 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27390 #pragma GCC diagnostic push
27391 #pragma GCC diagnostic ignored "-Wconversion"
27392 #endif
27393  const char neg_one = (char) -1, const_zero = (char) 0;
27394 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27395 #pragma GCC diagnostic pop
27396 #endif
27397  const int is_unsigned = neg_one > const_zero;
27398 #if PY_MAJOR_VERSION < 3
27399  if (likely(PyInt_Check(x))) {
27400  if (sizeof(char) < sizeof(long)) {
27401  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
27402  } else {
27403  long val = PyInt_AS_LONG(x);
27404  if (is_unsigned && unlikely(val < 0)) {
27405  goto raise_neg_overflow;
27406  }
27407  return (char) val;
27408  }
27409  } else
27410 #endif
27411  if (likely(PyLong_Check(x))) {
27412  if (is_unsigned) {
27413 #if CYTHON_USE_PYLONG_INTERNALS
27414  const digit* digits = ((PyLongObject*)x)->ob_digit;
27415  switch (Py_SIZE(x)) {
27416  case 0: return (char) 0;
27417  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
27418  case 2:
27419  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27420  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27421  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27422  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
27423  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27424  }
27425  }
27426  break;
27427  case 3:
27428  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27429  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27430  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27431  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
27432  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27433  }
27434  }
27435  break;
27436  case 4:
27437  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27438  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27439  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27440  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
27441  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27442  }
27443  }
27444  break;
27445  }
27446 #endif
27447 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27448  if (unlikely(Py_SIZE(x) < 0)) {
27449  goto raise_neg_overflow;
27450  }
27451 #else
27452  {
27453  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27454  if (unlikely(result < 0))
27455  return (char) -1;
27456  if (unlikely(result == 1))
27457  goto raise_neg_overflow;
27458  }
27459 #endif
27460  if (sizeof(char) <= sizeof(unsigned long)) {
27461  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
27462 #ifdef HAVE_LONG_LONG
27463  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
27464  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27465 #endif
27466  }
27467  } else {
27468 #if CYTHON_USE_PYLONG_INTERNALS
27469  const digit* digits = ((PyLongObject*)x)->ob_digit;
27470  switch (Py_SIZE(x)) {
27471  case 0: return (char) 0;
27472  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
27473  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27474  case -2:
27475  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27476  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27477  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27478  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27479  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27480  }
27481  }
27482  break;
27483  case 2:
27484  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27485  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27486  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27487  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27488  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27489  }
27490  }
27491  break;
27492  case -3:
27493  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27494  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27495  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27496  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27497  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27498  }
27499  }
27500  break;
27501  case 3:
27502  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27503  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27504  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27505  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27506  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27507  }
27508  }
27509  break;
27510  case -4:
27511  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27512  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27513  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27514  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27515  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27516  }
27517  }
27518  break;
27519  case 4:
27520  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27521  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27522  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27523  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27524  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27525  }
27526  }
27527  break;
27528  }
27529 #endif
27530  if (sizeof(char) <= sizeof(long)) {
27531  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27532 #ifdef HAVE_LONG_LONG
27533  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
27534  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
27535 #endif
27536  }
27537  }
27538  {
27539 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27540  PyErr_SetString(PyExc_RuntimeError,
27541  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27542 #else
27543  char val;
27544  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27545  #if PY_MAJOR_VERSION < 3
27546  if (likely(v) && !PyLong_Check(v)) {
27547  PyObject *tmp = v;
27548  v = PyNumber_Long(tmp);
27549  Py_DECREF(tmp);
27550  }
27551  #endif
27552  if (likely(v)) {
27553  int one = 1; int is_little = (int)*(unsigned char *)&one;
27554  unsigned char *bytes = (unsigned char *)&val;
27555  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27556  bytes, sizeof(val),
27557  is_little, !is_unsigned);
27558  Py_DECREF(v);
27559  if (likely(!ret))
27560  return val;
27561  }
27562 #endif
27563  return (char) -1;
27564  }
27565  } else {
27566  char val;
27567  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27568  if (!tmp) return (char) -1;
27569  val = __Pyx_PyInt_As_char(tmp);
27570  Py_DECREF(tmp);
27571  return val;
27572  }
27573 raise_overflow:
27574  PyErr_SetString(PyExc_OverflowError,
27575  "value too large to convert to char");
27576  return (char) -1;
27577 raise_neg_overflow:
27578  PyErr_SetString(PyExc_OverflowError,
27579  "can't convert negative value to char");
27580  return (char) -1;
27581 }
27582 
27583 /* CheckBinaryVersion */
27584  static int __Pyx_check_binary_version(void) {
27585  char ctversion[5];
27586  int same=1, i, found_dot;
27587  const char* rt_from_call = Py_GetVersion();
27588  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27589  found_dot = 0;
27590  for (i = 0; i < 4; i++) {
27591  if (!ctversion[i]) {
27592  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
27593  break;
27594  }
27595  if (rt_from_call[i] != ctversion[i]) {
27596  same = 0;
27597  break;
27598  }
27599  }
27600  if (!same) {
27601  char rtversion[5] = {'\0'};
27602  char message[200];
27603  for (i=0; i<4; ++i) {
27604  if (rt_from_call[i] == '.') {
27605  if (found_dot) break;
27606  found_dot = 1;
27607  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
27608  break;
27609  }
27610  rtversion[i] = rt_from_call[i];
27611  }
27612  PyOS_snprintf(message, sizeof(message),
27613  "compiletime version %s of module '%.100s' "
27614  "does not match runtime version %s",
27615  ctversion, __Pyx_MODULE_NAME, rtversion);
27616  return PyErr_WarnEx(NULL, message, 1);
27617  }
27618  return 0;
27619 }
27620 
27621 /* FunctionExport */
27622  static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
27623  PyObject *d = 0;
27624  PyObject *cobj = 0;
27625  union {
27626  void (*fp)(void);
27627  void *p;
27628  } tmp;
27629  d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
27630  if (!d) {
27631  PyErr_Clear();
27632  d = PyDict_New();
27633  if (!d)
27634  goto bad;
27635  Py_INCREF(d);
27636  if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
27637  goto bad;
27638  }
27639  tmp.fp = f;
27640 #if PY_VERSION_HEX >= 0x02070000
27641  cobj = PyCapsule_New(tmp.p, sig, 0);
27642 #else
27643  cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
27644 #endif
27645  if (!cobj)
27646  goto bad;
27647  if (PyDict_SetItemString(d, name, cobj) < 0)
27648  goto bad;
27649  Py_DECREF(cobj);
27650  Py_DECREF(d);
27651  return 0;
27652 bad:
27653  Py_XDECREF(cobj);
27654  Py_XDECREF(d);
27655  return -1;
27656 }
27657 
27658 /* FunctionImport */
27659  #ifndef __PYX_HAVE_RT_ImportFunction_0_29_36
27660 #define __PYX_HAVE_RT_ImportFunction_0_29_36
27661 static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
27662  PyObject *d = 0;
27663  PyObject *cobj = 0;
27664  union {
27665  void (*fp)(void);
27666  void *p;
27667  } tmp;
27668  d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
27669  if (!d)
27670  goto bad;
27671  cobj = PyDict_GetItemString(d, funcname);
27672  if (!cobj) {
27673  PyErr_Format(PyExc_ImportError,
27674  "%.200s does not export expected C function %.200s",
27675  PyModule_GetName(module), funcname);
27676  goto bad;
27677  }
27678 #if PY_VERSION_HEX >= 0x02070000
27679  if (!PyCapsule_IsValid(cobj, sig)) {
27680  PyErr_Format(PyExc_TypeError,
27681  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
27682  PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
27683  goto bad;
27684  }
27685  tmp.p = PyCapsule_GetPointer(cobj, sig);
27686 #else
27687  {const char *desc, *s1, *s2;
27688  desc = (const char *)PyCObject_GetDesc(cobj);
27689  if (!desc)
27690  goto bad;
27691  s1 = desc; s2 = sig;
27692  while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
27693  if (*s1 != *s2) {
27694  PyErr_Format(PyExc_TypeError,
27695  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
27696  PyModule_GetName(module), funcname, sig, desc);
27697  goto bad;
27698  }
27699  tmp.p = PyCObject_AsVoidPtr(cobj);}
27700 #endif
27701  *f = tmp.fp;
27702  if (!(*f))
27703  goto bad;
27704  Py_DECREF(d);
27705  return 0;
27706 bad:
27707  Py_XDECREF(d);
27708  return -1;
27709 }
27710 #endif
27711 
27712 /* InitStrings */
27713  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27714  while (t->p) {
27715  #if PY_MAJOR_VERSION < 3
27716  if (t->is_unicode) {
27717  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27718  } else if (t->intern) {
27719  *t->p = PyString_InternFromString(t->s);
27720  } else {
27721  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27722  }
27723  #else
27724  if (t->is_unicode | t->is_str) {
27725  if (t->intern) {
27726  *t->p = PyUnicode_InternFromString(t->s);
27727  } else if (t->encoding) {
27728  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27729  } else {
27730  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27731  }
27732  } else {
27733  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27734  }
27735  #endif
27736  if (!*t->p)
27737  return -1;
27738  if (PyObject_Hash(*t->p) == -1)
27739  return -1;
27740  ++t;
27741  }
27742  return 0;
27743 }
27744 
27745 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27746  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27747 }
27748 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27749  Py_ssize_t ignore;
27750  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27751 }
27752 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27753 #if !CYTHON_PEP393_ENABLED
27754 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27755  char* defenc_c;
27756  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27757  if (!defenc) return NULL;
27758  defenc_c = PyBytes_AS_STRING(defenc);
27759 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27760  {
27761  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27762  char* c;
27763  for (c = defenc_c; c < end; c++) {
27764  if ((unsigned char) (*c) >= 128) {
27765  PyUnicode_AsASCIIString(o);
27766  return NULL;
27767  }
27768  }
27769  }
27770 #endif
27771  *length = PyBytes_GET_SIZE(defenc);
27772  return defenc_c;
27773 }
27774 #else
27775 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27776  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27777 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27778  if (likely(PyUnicode_IS_ASCII(o))) {
27779  *length = PyUnicode_GET_LENGTH(o);
27780  return PyUnicode_AsUTF8(o);
27781  } else {
27782  PyUnicode_AsASCIIString(o);
27783  return NULL;
27784  }
27785 #else
27786  return PyUnicode_AsUTF8AndSize(o, length);
27787 #endif
27788 }
27789 #endif
27790 #endif
27791 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27792 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27793  if (
27794 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27795  __Pyx_sys_getdefaultencoding_not_ascii &&
27796 #endif
27797  PyUnicode_Check(o)) {
27798  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27799  } else
27800 #endif
27801 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27802  if (PyByteArray_Check(o)) {
27803  *length = PyByteArray_GET_SIZE(o);
27804  return PyByteArray_AS_STRING(o);
27805  } else
27806 #endif
27807  {
27808  char* result;
27809  int r = PyBytes_AsStringAndSize(o, &result, length);
27810  if (unlikely(r < 0)) {
27811  return NULL;
27812  } else {
27813  return result;
27814  }
27815  }
27816 }
27817 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27818  int is_true = x == Py_True;
27819  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
27820  else return PyObject_IsTrue(x);
27821 }
27822 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27823  int retval;
27824  if (unlikely(!x)) return -1;
27825  retval = __Pyx_PyObject_IsTrue(x);
27826  Py_DECREF(x);
27827  return retval;
27828 }
27829 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
27830 #if PY_MAJOR_VERSION >= 3
27831  if (PyLong_Check(result)) {
27832  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27833  "__int__ returned non-int (type %.200s). "
27834  "The ability to return an instance of a strict subclass of int "
27835  "is deprecated, and may be removed in a future version of Python.",
27836  Py_TYPE(result)->tp_name)) {
27837  Py_DECREF(result);
27838  return NULL;
27839  }
27840  return result;
27841  }
27842 #endif
27843  PyErr_Format(PyExc_TypeError,
27844  "__%.4s__ returned non-%.4s (type %.200s)",
27845  type_name, type_name, Py_TYPE(result)->tp_name);
27846  Py_DECREF(result);
27847  return NULL;
27848 }
27849 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27850 #if CYTHON_USE_TYPE_SLOTS
27851  PyNumberMethods *m;
27852 #endif
27853  const char *name = NULL;
27854  PyObject *res = NULL;
27855 #if PY_MAJOR_VERSION < 3
27856  if (likely(PyInt_Check(x) || PyLong_Check(x)))
27857 #else
27858  if (likely(PyLong_Check(x)))
27859 #endif
27860  return __Pyx_NewRef(x);
27861 #if CYTHON_USE_TYPE_SLOTS
27862  m = Py_TYPE(x)->tp_as_number;
27863  #if PY_MAJOR_VERSION < 3
27864  if (m && m->nb_int) {
27865  name = "int";
27866  res = m->nb_int(x);
27867  }
27868  else if (m && m->nb_long) {
27869  name = "long";
27870  res = m->nb_long(x);
27871  }
27872  #else
27873  if (likely(m && m->nb_int)) {
27874  name = "int";
27875  res = m->nb_int(x);
27876  }
27877  #endif
27878 #else
27879  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27880  res = PyNumber_Int(x);
27881  }
27882 #endif
27883  if (likely(res)) {
27884 #if PY_MAJOR_VERSION < 3
27885  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27886 #else
27887  if (unlikely(!PyLong_CheckExact(res))) {
27888 #endif
27889  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27890  }
27891  }
27892  else if (!PyErr_Occurred()) {
27893  PyErr_SetString(PyExc_TypeError,
27894  "an integer is required");
27895  }
27896  return res;
27897 }
27898 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27899  Py_ssize_t ival;
27900  PyObject *x;
27901 #if PY_MAJOR_VERSION < 3
27902  if (likely(PyInt_CheckExact(b))) {
27903  if (sizeof(Py_ssize_t) >= sizeof(long))
27904  return PyInt_AS_LONG(b);
27905  else
27906  return PyInt_AsSsize_t(b);
27907  }
27908 #endif
27909  if (likely(PyLong_CheckExact(b))) {
27910  #if CYTHON_USE_PYLONG_INTERNALS
27911  const digit* digits = ((PyLongObject*)b)->ob_digit;
27912  const Py_ssize_t size = Py_SIZE(b);
27913  if (likely(__Pyx_sst_abs(size) <= 1)) {
27914  ival = likely(size) ? digits[0] : 0;
27915  if (size == -1) ival = -ival;
27916  return ival;
27917  } else {
27918  switch (size) {
27919  case 2:
27920  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27921  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27922  }
27923  break;
27924  case -2:
27925  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27926  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27927  }
27928  break;
27929  case 3:
27930  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27931  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27932  }
27933  break;
27934  case -3:
27935  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27936  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27937  }
27938  break;
27939  case 4:
27940  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27941  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27942  }
27943  break;
27944  case -4:
27945  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27946  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27947  }
27948  break;
27949  }
27950  }
27951  #endif
27952  return PyLong_AsSsize_t(b);
27953  }
27954  x = PyNumber_Index(b);
27955  if (!x) return -1;
27956  ival = PyInt_AsSsize_t(x);
27957  Py_DECREF(x);
27958  return ival;
27959 }
27960 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
27961  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
27962  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
27963 #if PY_MAJOR_VERSION < 3
27964  } else if (likely(PyInt_CheckExact(o))) {
27965  return PyInt_AS_LONG(o);
27966 #endif
27967  } else {
27968  Py_ssize_t ival;
27969  PyObject *x;
27970  x = PyNumber_Index(o);
27971  if (!x) return -1;
27972  ival = PyInt_AsLong(x);
27973  Py_DECREF(x);
27974  return ival;
27975  }
27976 }
27977 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
27978  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27979 }
27980 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
27981  return PyInt_FromSize_t(ival);
27982 }
27983 
27984 
27985 #endif /* Py_PYTHON_H */
Defines the function .
Definition: functions.h:38
Base class for linear operators. This class serves as interface for all derived classes.
static FlagType c_trace_estimator(cLinearOperator< DataType > *A, DataType *parameters, const IndexType num_inquiries, const Function *matrix_function, const FlagType gram, const DataType exponent, const FlagType orthogonalize, const IndexType lanczos_degree, const DataType lanczos_tol, const IndexType min_num_samples, const IndexType max_num_samples, const DataType error_atol, const DataType error_rtol, const DataType confidence_level, const DataType outlier_significance_level, const IndexType num_threads, DataType *trace, DataType *error, DataType **samples, IndexType *processed_samples_indices, IndexType *num_samples_used, IndexType *num_outliers, FlagType *converged, float &alg_wall_time)
Stochastic Lanczos quadrature method to estimate trace of a function of a linear operator....
void lapack_sbdsdc(char *uplo, char *compq, int *n, float *d, float *e, float *u, int *ldu, float *vt, int *ldvt, float *q, int *iq, float *work, int *iwork, int *info)
void lapack_dstev(char *jobz, int *n, double *d, double *e, double *z, int *ldz, double *work, int *info)
void lapack_dbdsdc(char *uplo, char *compq, int *n, double *d, double *e, double *u, int *ldu, double *vt, int *ldvt, double *q, int *iq, double *work, int *iwork, int *info)
#define __PYX_EXTERN_C
__PYX_EXTERN_C void lapack_sstev(char *, int *, float *, float *, float *, int *, float *, int *)
PyMODINIT_FUNC initpy_c_trace_estimator(void)